Skip to content

Commit

Permalink
tools: replace RocksDB version information with the Speedb version (s…
Browse files Browse the repository at this point in the history
…peedb-io#64)

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 authored and Yuval-Ariel committed Nov 25, 2022
1 parent a9e9f3d commit b293388
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cache/cache_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 @@ -622,8 +623,10 @@ class CacheBench {
#ifndef NDEBUG
printf("WARNING: Assertions are enabled; benchmarks unnecessarily slow\n");
#endif
printf("RocksDB version : %d.%d\n", kMajorVersion, kMinorVersion);
printf("Speedb version : %s\n",
GetSpeedbVersionAsString(false).c_str());
printf("DMutex impl name : %s\n", DMutex::kName());

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 @@ -21,6 +21,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 @@ -2239,8 +2240,8 @@ uint32_t StressTest::GetRangeHash(ThreadState* thread, const Snapshot* snapshot,
}

void StressTest::PrintEnv() const {
fprintf(stdout, "Speedb 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 @@ -73,6 +73,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 @@ -2926,8 +2927,8 @@ class Benchmark {
#endif

void PrintEnvironment() {
fprintf(stderr, "RocksDB: version %s\n",
GetRocksVersionAsString(true).c_str());
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 @@ -137,8 +139,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 b293388

Please sign in to comment.