From 108e6b6354af1687b2e9b66914a843545fb611bf Mon Sep 17 00:00:00 2001 From: Zhichao Cao Date: Tue, 2 Feb 2021 10:50:28 -0800 Subject: [PATCH] Return Status::OK for unimplemented write batch handler in trace analyzer (#7910) Summary: The unimplemented handler will return Status::InvalidArgument() and caused issues when using trace analyzer for write batch record. Override with returning Status::OK() Pull Request resolved: https://github.com/facebook/rocksdb/pull/7910 Test Plan: tested with real trace, make check Reviewed By: siying Differential Revision: D26154327 Pulled By: zhichao-cao fbshipit-source-id: bcdefd4891f839b2e89e4c079f9f430245f482fb --- tools/trace_analyzer_tool.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tools/trace_analyzer_tool.h b/tools/trace_analyzer_tool.h index 2ca877df4..82210c1c7 100644 --- a/tools/trace_analyzer_tool.h +++ b/tools/trace_analyzer_tool.h @@ -281,6 +281,37 @@ class TraceWriteHandler : public WriteBatch::Handler { return ta_ptr->HandleMerge(column_family_id, key, value); } + // The following hanlders are not implemented, return Status::OK() to avoid + // the running time assertion and other irrelevant falures. + virtual Status PutBlobIndexCF(uint32_t /*column_family_id*/, + const Slice& /*key*/, + const Slice& /*value*/) override { + return Status::OK(); + } + + // The default implementation of LogData does nothing. + virtual void LogData(const Slice& /*blob*/) override {} + + virtual Status MarkBeginPrepare(bool = false) override { + return Status::OK(); + } + + virtual Status MarkEndPrepare(const Slice& /*xid*/) override { + return Status::OK(); + } + + virtual Status MarkNoop(bool /*empty_batch*/) override { + return Status::OK(); + } + + virtual Status MarkRollback(const Slice& /*xid*/) override { + return Status::OK(); + } + + virtual Status MarkCommit(const Slice& /*xid*/) override { + return Status::OK(); + } + private: TraceAnalyzer* ta_ptr; };