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
main
Andrew Kryczka 7 years ago committed by Facebook Github Bot
parent 186c7eedb0
commit d70ce7ee0b
  1. 8
      tools/db_bench_tool.cc

@ -72,7 +72,6 @@
#include <io.h> // 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 {

Loading…
Cancel
Save