From d70ce7ee0bfc0567477e55f1f10ce0d81050d62a Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Tue, 7 Feb 2017 11:34:14 -0800 Subject: [PATCH] Move db_bench flags out of unnamed namespace Summary: I want to be able to, e.g., DECLARE_string(statistics_string); in my application such that I can override the default value of statistics_string. For this to work, we need to remove the unnamed namespace containing all the flags, and make sure all variables/functions covered by that namespace are static. Replaces #1828 due to internal tool issues. Closes https://github.com/facebook/rocksdb/pull/1844 Differential Revision: D4515124 Pulled By: ajkr fbshipit-source-id: 23b695e --- tools/db_bench_tool.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 571747802..c4268dcc9 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -72,7 +72,6 @@ #include // open/close #endif -namespace { using GFLAGS::ParseCommandLineFlags; using GFLAGS::RegisterFlagValidator; using GFLAGS::SetUsageMessage; @@ -604,7 +603,7 @@ DEFINE_bool(use_stderr_info_logger, false, DEFINE_bool(use_blob_db, false, "Whether to use BlobDB. "); -enum rocksdb::CompressionType StringToCompressionType(const char* ctype) { +static enum rocksdb::CompressionType StringToCompressionType(const char* ctype) { assert(ctype); if (!strcasecmp(ctype, "none")) @@ -628,7 +627,7 @@ enum rocksdb::CompressionType StringToCompressionType(const char* ctype) { return rocksdb::kSnappyCompression; // default value } -std::string ColumnFamilyName(size_t i) { +static std::string ColumnFamilyName(size_t i) { if (i == 0) { return rocksdb::kDefaultColumnFamilyName; } else { @@ -872,7 +871,7 @@ enum RepFactory { kCuckoo }; -enum RepFactory StringToRepFactory(const char* ctype) { +static enum RepFactory StringToRepFactory(const char* ctype) { assert(ctype); if (!strcasecmp(ctype, "skip_list")) @@ -940,7 +939,6 @@ static const bool FLAGS_deletepercent_dummy __attribute__((unused)) = static const bool FLAGS_table_cache_numshardbits_dummy __attribute__((unused)) = RegisterFlagValidator(&FLAGS_table_cache_numshardbits, &ValidateTableCacheNumshardbits); -} // namespace namespace rocksdb {