Support PutEntity in trace analyzer (#11127)

Summary:
Add the most basic support such that trace_analyzer commands no longer fail with
```
Cannot process the write batch in the trace
Cannot process the TraceRecord
PutEntityCF not implemented
Cannot process the trace
```

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11127

Reviewed By: cbi42

Differential Revision: D42732319

Pulled By: ajkr

fbshipit-source-id: 162d8a31318672a46539b1b042ec25f69b25c4ed
oxigraph-8.1.1
Andrew Kryczka 2 years ago committed by Facebook GitHub Bot
parent 546e213c4f
commit 6a5071ceb5
  1. 2
      tools/trace_analyzer_test.cc
  2. 6
      tools/trace_analyzer_tool.cc
  3. 7
      tools/trace_analyzer_tool.h

@ -336,7 +336,7 @@ TEST_F(TraceAnalyzerTest, Put) {
CheckFileContent(k_whole_prefix, file_path, true); CheckFileContent(k_whole_prefix, file_path, true);
// Check the overall qps // Check the overall qps
std::vector<std::string> all_qps = {"0 1 0 0 0 0 0 0 0 1"}; std::vector<std::string> all_qps = {"0 1 0 0 0 0 0 0 0 0 1"};
file_path = output_path + "/test-qps_stats.txt"; file_path = output_path + "/test-qps_stats.txt";
CheckFileContent(all_qps, file_path, true); CheckFileContent(all_qps, file_path, true);

@ -1582,6 +1582,12 @@ Status TraceAnalyzer::PutCF(uint32_t column_family_id, const Slice& key,
column_family_id, key, value.size()); column_family_id, key, value.size());
} }
Status TraceAnalyzer::PutEntityCF(uint32_t column_family_id, const Slice& key,
const Slice& value) {
return OutputAnalysisResult(TraceOperationType::kPutEntity, write_batch_ts_,
column_family_id, key, value.size());
}
// Handle the Delete request in the write batch of the trace // Handle the Delete request in the write batch of the trace
Status TraceAnalyzer::DeleteCF(uint32_t column_family_id, const Slice& key) { Status TraceAnalyzer::DeleteCF(uint32_t column_family_id, const Slice& key) {
return OutputAnalysisResult(TraceOperationType::kDelete, write_batch_ts_, return OutputAnalysisResult(TraceOperationType::kDelete, write_batch_ts_,

@ -35,7 +35,8 @@ enum TraceOperationType : int {
kIteratorSeek = 6, kIteratorSeek = 6,
kIteratorSeekForPrev = 7, kIteratorSeekForPrev = 7,
kMultiGet = 8, kMultiGet = 8,
kTaTypeNum = 9 kPutEntity = 9,
kTaTypeNum = 10
}; };
struct TraceUnit { struct TraceUnit {
@ -201,6 +202,10 @@ class TraceAnalyzer : private TraceRecord::Handler,
Status PutCF(uint32_t column_family_id, const Slice& key, Status PutCF(uint32_t column_family_id, const Slice& key,
const Slice& value) override; const Slice& value) override;
using WriteBatch::Handler::PutEntityCF;
Status PutEntityCF(uint32_t column_family_id, const Slice& key,
const Slice& value) override;
using WriteBatch::Handler::DeleteCF; using WriteBatch::Handler::DeleteCF;
Status DeleteCF(uint32_t column_family_id, const Slice& key) override; Status DeleteCF(uint32_t column_family_id, const Slice& key) override;

Loading…
Cancel
Save