diff --git a/trace_replay/block_cache_tracer.cc b/trace_replay/block_cache_tracer.cc index 9a96f1bac..350fc3d5c 100644 --- a/trace_replay/block_cache_tracer.cc +++ b/trace_replay/block_cache_tracer.cc @@ -19,8 +19,6 @@ namespace ROCKSDB_NAMESPACE { namespace { -const unsigned int kCharSize = 1; - bool ShouldTrace(const Slice& block_key, const TraceOptions& trace_options) { if (trace_options.sampling_frequency == 0 || trace_options.sampling_frequency == 1) { @@ -217,6 +215,8 @@ Status BlockCacheTraceReader::ReadAccess(BlockCacheTraceRecord* record) { record->block_type = trace.type; Slice enc_slice = Slice(trace.payload); + const unsigned int kCharSize = 1; + Slice block_key; if (!GetLengthPrefixedSlice(&enc_slice, &block_key)) { return Status::Incomplete( diff --git a/trace_replay/io_tracer.cc b/trace_replay/io_tracer.cc index c9787ea86..d9f701587 100644 --- a/trace_replay/io_tracer.cc +++ b/trace_replay/io_tracer.cc @@ -17,11 +17,6 @@ #include "util/string_util.h" namespace ROCKSDB_NAMESPACE { - -namespace { -const unsigned int kCharSize = 1; -} // namespace - IOTraceWriter::IOTraceWriter(Env* env, const TraceOptions& trace_options, std::unique_ptr&& trace_writer) : env_(env), @@ -143,6 +138,7 @@ Status IOTraceReader::ReadIOOp(IOTraceRecord* record) { record->file_name = file_name.ToString(); // TODO: Read below options based on file_operation. record->len = static_cast(enc_slice[0]); + const unsigned int kCharSize = 1; enc_slice.remove_prefix(kCharSize); if (enc_slice.empty()) { return Status::Incomplete(