提交 6a5071ce 编写于 作者: A Andrew Kryczka 提交者: Facebook GitHub Bot

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
上级 546e213c
......@@ -336,7 +336,7 @@ TEST_F(TraceAnalyzerTest, Put) {
CheckFileContent(k_whole_prefix, file_path, true);
// 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";
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());
}
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
Status TraceAnalyzer::DeleteCF(uint32_t column_family_id, const Slice& key) {
return OutputAnalysisResult(TraceOperationType::kDelete, write_batch_ts_,
......
......@@ -35,7 +35,8 @@ enum TraceOperationType : int {
kIteratorSeek = 6,
kIteratorSeekForPrev = 7,
kMultiGet = 8,
kTaTypeNum = 9
kPutEntity = 9,
kTaTypeNum = 10
};
struct TraceUnit {
......@@ -201,6 +202,10 @@ class TraceAnalyzer : private TraceRecord::Handler,
Status PutCF(uint32_t column_family_id, const Slice& key,
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;
Status DeleteCF(uint32_t column_family_id, const Slice& key) override;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册