Skip to content

Commit

Permalink
tools: replace RocksDB version information with the Speedb version (#64)
Browse files Browse the repository at this point in the history
This is done across all tools except trace_replay, which specifically
looks for the RocksDB version for database compatibility checks.
  • Loading branch information
isaac-io committed Oct 25, 2022
1 parent 307bf01 commit 1169c43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion cache/cache_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "rocksdb/secondary_cache.h"
#include "rocksdb/system_clock.h"
#include "rocksdb/table_properties.h"
#include "speedb/version.h"
#include "table/block_based/block_based_table_reader.h"
#include "table/block_based/cachable_entry.h"
#include "util/coding.h"
Expand Down Expand Up @@ -579,7 +580,8 @@ class CacheBench {
}

void PrintEnv() const {
printf("RocksDB version : %d.%d\n", kMajorVersion, kMinorVersion);
printf("Speedb version : %s\n",
GetSpeedbVersionAsString(false).c_str());
printf("Number of threads : %u\n", FLAGS_threads);
printf("Ops per thread : %" PRIu64 "\n", FLAGS_ops_per_thread);
printf("Cache size : %s\n",
Expand Down
5 changes: 3 additions & 2 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "rocksdb/sst_file_manager.h"
#include "rocksdb/types.h"
#include "rocksdb/utilities/object_registry.h"
#include "speedb/version.h"
#include "test_util/testutil.h"
#include "util/cast_util.h"
#include "utilities/backup/backup_engine_impl.h"
Expand Down Expand Up @@ -2188,8 +2189,8 @@ uint32_t StressTest::GetRangeHash(ThreadState* thread, const Snapshot* snapshot,
}

void StressTest::PrintEnv() const {
fprintf(stdout, "RocksDB version : %d.%d\n", kMajorVersion,
kMinorVersion);
fprintf(stdout, "Speedb version : %s\n",
GetSpeedbVersionAsString(false).c_str());
fprintf(stdout, "Format version : %d\n", FLAGS_format_version);
fprintf(stdout, "TransactionDB : %s\n",
FLAGS_use_txn ? "true" : "false");
Expand Down
5 changes: 3 additions & 2 deletions tools/db_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "rocksdb/utilities/transaction.h"
#include "rocksdb/utilities/transaction_db.h"
#include "rocksdb/write_batch.h"
#include "speedb/version.h"
#include "test_util/testutil.h"
#include "test_util/transaction_test_util.h"
#include "tools/simulated_hybrid_file_system.h"
Expand Down Expand Up @@ -2701,8 +2702,8 @@ class Benchmark {
#endif

void PrintEnvironment() {
fprintf(stderr, "RocksDB: version %d.%d\n",
kMajorVersion, kMinorVersion);
fprintf(stderr, "Speedb: version %s\n",
GetSpeedbVersionAsString(false).c_str());

#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__)
time_t now = time(nullptr);
Expand Down
5 changes: 3 additions & 2 deletions tools/ldb_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
//
#ifndef ROCKSDB_LITE
#include "rocksdb/ldb_tool.h"

#include "rocksdb/utilities/ldb_cmd.h"
#include "speedb/version.h"
#include "tools/ldb_cmd_impl.h"

namespace ROCKSDB_NAMESPACE {
Expand Down Expand Up @@ -134,8 +136,7 @@ int LDBCommandRunner::RunCommand(
PrintHelp(ldb_options, argv[0], /*to_stderr*/ true);
return 1;
} else if (std::string(argv[1]) == "--version") {
printf("ldb from RocksDB %d.%d.%d\n", ROCKSDB_MAJOR, ROCKSDB_MINOR,
ROCKSDB_PATCH);
printf("%s\n", GetRocksBuildInfoAsString("ldb").c_str());
return 0;
} else if (std::string(argv[1]) == "--help") {
PrintHelp(ldb_options, argv[0], /*to_stderr*/ false);
Expand Down

0 comments on commit 1169c43

Please sign in to comment.