|
|
@ -104,6 +104,7 @@ |
|
|
|
using GFLAGS_NAMESPACE::ParseCommandLineFlags; |
|
|
|
using GFLAGS_NAMESPACE::ParseCommandLineFlags; |
|
|
|
using GFLAGS_NAMESPACE::RegisterFlagValidator; |
|
|
|
using GFLAGS_NAMESPACE::RegisterFlagValidator; |
|
|
|
using GFLAGS_NAMESPACE::SetUsageMessage; |
|
|
|
using GFLAGS_NAMESPACE::SetUsageMessage; |
|
|
|
|
|
|
|
using GFLAGS_NAMESPACE::SetVersionString; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef ROCKSDB_LITE |
|
|
|
#ifdef ROCKSDB_LITE |
|
|
|
#define IF_ROCKSDB_LITE(Then, Else) Then |
|
|
|
#define IF_ROCKSDB_LITE(Then, Else) Then |
|
|
@ -1677,6 +1678,9 @@ DEFINE_uint32(write_batch_protection_bytes_per_key, 0, |
|
|
|
"Size of per-key-value checksum in each write batch. Currently " |
|
|
|
"Size of per-key-value checksum in each write batch. Currently " |
|
|
|
"only value 0 and 8 are supported."); |
|
|
|
"only value 0 and 8 are supported."); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEFINE_bool(build_info, false, |
|
|
|
|
|
|
|
"Print the build info via GetRocksBuildInfoAsString"); |
|
|
|
|
|
|
|
|
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
|
namespace { |
|
|
|
namespace { |
|
|
|
static Status CreateMemTableRepFactory( |
|
|
|
static Status CreateMemTableRepFactory( |
|
|
@ -2843,8 +2847,8 @@ class Benchmark { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void PrintEnvironment() { |
|
|
|
void PrintEnvironment() { |
|
|
|
fprintf(stderr, "RocksDB: version %d.%d\n", |
|
|
|
fprintf(stderr, "RocksDB: version %s\n", |
|
|
|
kMajorVersion, kMinorVersion); |
|
|
|
GetRocksVersionAsString(true).c_str()); |
|
|
|
|
|
|
|
|
|
|
|
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) |
|
|
|
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) |
|
|
|
time_t now = time(nullptr); |
|
|
|
time_t now = time(nullptr); |
|
|
@ -8384,6 +8388,7 @@ int db_bench_tool(int argc, char** argv) { |
|
|
|
if (!initialized) { |
|
|
|
if (!initialized) { |
|
|
|
SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) + |
|
|
|
SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) + |
|
|
|
" [OPTIONS]..."); |
|
|
|
" [OPTIONS]..."); |
|
|
|
|
|
|
|
SetVersionString(GetRocksVersionAsString(true)); |
|
|
|
initialized = true; |
|
|
|
initialized = true; |
|
|
|
} |
|
|
|
} |
|
|
|
ParseCommandLineFlags(&argc, &argv, true); |
|
|
|
ParseCommandLineFlags(&argc, &argv, true); |
|
|
@ -8469,6 +8474,13 @@ int db_bench_tool(int argc, char** argv) { |
|
|
|
FLAGS_use_existing_db |= FLAGS_readonly; |
|
|
|
FLAGS_use_existing_db |= FLAGS_readonly; |
|
|
|
#endif // ROCKSDB_LITE
|
|
|
|
#endif // ROCKSDB_LITE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (FLAGS_build_info) { |
|
|
|
|
|
|
|
std::string build_info; |
|
|
|
|
|
|
|
std::cout << GetRocksBuildInfoAsString(build_info, true) << std::endl; |
|
|
|
|
|
|
|
// Similar to --version, nothing else will be done when this flag is set
|
|
|
|
|
|
|
|
exit(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!FLAGS_seed) { |
|
|
|
if (!FLAGS_seed) { |
|
|
|
uint64_t now = FLAGS_env->GetSystemClock()->NowMicros(); |
|
|
|
uint64_t now = FLAGS_env->GetSystemClock()->NowMicros(); |
|
|
|
seed_base = static_cast<int64_t>(now); |
|
|
|
seed_base = static_cast<int64_t>(now); |
|
|
|