From 66c0385fe0a0b88c81e0737e33e4ef664af25f01 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Fri, 27 May 2016 12:58:26 +0200 Subject: [PATCH] added RocksDB version information, fixed comparator --- arangod/Indexes/RocksDBFeature.cpp | 10 ++++++++++ lib/Rest/Version.cpp | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/arangod/Indexes/RocksDBFeature.cpp b/arangod/Indexes/RocksDBFeature.cpp index d4781050d4..aea92f8e7c 100644 --- a/arangod/Indexes/RocksDBFeature.cpp +++ b/arangod/Indexes/RocksDBFeature.cpp @@ -209,6 +209,11 @@ int RocksDBFeature::dropPrefix(std::string const& prefix) { std::string l; l.reserve(prefix.size() + builder.slice().byteSize()); l.append(prefix); + // extend the prefix to at least 24 bytes + while (l.size() < RocksDBIndex::keyPrefixSize()) { + uint64_t value = 0; + l.append(reinterpret_cast(&value), sizeof(uint64_t)); + } l.append(builder.slice().startAs(), builder.slice().byteSize()); builder.clear(); @@ -219,6 +224,11 @@ int RocksDBFeature::dropPrefix(std::string const& prefix) { std::string u; u.reserve(prefix.size() + builder.slice().byteSize()); u.append(prefix); + // extend the prefix to at least 24 bytes + while (u.size() < RocksDBIndex::keyPrefixSize()) { + uint64_t value = UINT64_MAX; + u.append(reinterpret_cast(&value), sizeof(uint64_t)); + } u.append(builder.slice().startAs(), builder.slice().byteSize()); #if 0 diff --git a/lib/Rest/Version.cpp b/lib/Rest/Version.cpp index 0b7eb31fed..4c1689999f 100644 --- a/lib/Rest/Version.cpp +++ b/lib/Rest/Version.cpp @@ -39,6 +39,10 @@ #include "Basics/build-date.h" #include "Basics/conversions.h" +#ifdef ARANGODB_ENABLE_ROCKSDB +#include +#endif + using namespace arangodb::rest; std::map Version::Values; @@ -105,6 +109,10 @@ void Version::initialize() { Values["vpack-version"] = getVPackVersion(); Values["zlib-version"] = getZLibVersion(); +#ifdef ARANGODB_ENABLE_ROCKSDB + Values["rocksdb-version"] = std::to_string(ROCKSDB_MAJOR) + "." + std::to_string(ROCKSDB_MINOR) + "." + std::to_string(ROCKSDB_PATCH); +#endif + #ifdef __cplusplus Values["cplusplus"] = std::to_string(__cplusplus); #else