diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index e2de696ef..55f89eab3 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -101,7 +101,6 @@ namespace rocksdb { const std::string kDefaultColumnFamilyName("default"); const std::string kPersistentStatsColumnFamilyName( "___rocksdb_stats_history___"); -const int kMicrosInSecond = 1000 * 1000; void DumpRocksDBBuildVersion(Logger* log); CompressionType GetCompressionFlush( diff --git a/tools/block_cache_trace_analyzer_test.cc b/tools/block_cache_trace_analyzer_test.cc index 80734565a..21d8bcbbb 100644 --- a/tools/block_cache_trace_analyzer_test.cc +++ b/tools/block_cache_trace_analyzer_test.cc @@ -91,7 +91,7 @@ class BlockCacheTracerTest : public testing::Test { assert(writer); for (uint32_t i = 0; i < nblocks; i++) { uint32_t key_id = from_key_id + i; - uint32_t timestamp = (key_id + 1) * kMicrosInSecond; + uint64_t timestamp = (key_id + 1) * kMicrosInSecond; BlockCacheTraceRecord record; record.block_type = block_type; record.block_size = kBlockSize + key_id; diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 8344669b7..abffae5d9 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -1547,7 +1547,6 @@ class ReporterAgent { private: std::string Header() const { return "secs_elapsed,interval_qps"; } void SleepAndReport() { - uint64_t kMicrosInSecond = 1000 * 1000; auto time_started = env_->NowMicros(); while (true) { { diff --git a/trace_replay/block_cache_tracer.cc b/trace_replay/block_cache_tracer.cc index b163216d8..cc875bf0d 100644 --- a/trace_replay/block_cache_tracer.cc +++ b/trace_replay/block_cache_tracer.cc @@ -28,6 +28,7 @@ bool ShouldTrace(const Slice& block_key, const TraceOptions& trace_options) { } } // namespace +const uint64_t kMicrosInSecond = 1000 * 1000; const std::string BlockCacheTraceHelper::kUnknownColumnFamilyName = "UnknownColumnFamily"; diff --git a/trace_replay/block_cache_tracer.h b/trace_replay/block_cache_tracer.h index e2ad933b9..e21111727 100644 --- a/trace_replay/block_cache_tracer.h +++ b/trace_replay/block_cache_tracer.h @@ -16,6 +16,8 @@ namespace rocksdb { +extern const uint64_t kMicrosInSecond; + // Lookup context for tracing block cache accesses. // We trace block accesses at five places: // 1. BlockBasedTable::GetFilter diff --git a/utilities/simulator_cache/cache_simulator.h b/utilities/simulator_cache/cache_simulator.h index 37166d8a9..b391d5dc8 100644 --- a/utilities/simulator_cache/cache_simulator.h +++ b/utilities/simulator_cache/cache_simulator.h @@ -10,8 +10,6 @@ namespace rocksdb { -const uint64_t kMicrosInSecond = 1000000; - // A cache configuration provided by user. struct CacheConfiguration { std::string cache_name; // LRU.