forked from Level/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump rocksdb to commit c4cd8e1accfd010bba9a919e234ba04505071cc1 (v.7.…
…2.2+commits) Resolves: Level#198
- Loading branch information
Showing
4 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,61 @@ | ||
#include "rocksdb/util/build_version.h" | ||
#include "rocksdb/version.h" | ||
#include "rocksdb/utilities/object_registry.h" | ||
|
||
// In original RocksDB build the following variables and functions are generated either by CMake or Makefile | ||
|
||
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:None"; | ||
const char* rocksdb_build_git_date = "rocksdb_build_git_date:None"; | ||
const char* rocksdb_build_compile_date = "None"; | ||
const char* rocksdb_build_git_tag = "rocksdb_build_git_tag:None"; | ||
const char* rocksdb_build_date = "rocksdb_build_date:None"; | ||
|
||
std::unordered_map<std::string, ROCKSDB_NAMESPACE::RegistrarFunc> ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = {}; | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
|
||
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) { | ||
size_t colon = name.find(":"); | ||
if (colon != std::string::npos && colon > 0 && colon < name.length() - 1) { | ||
// If we found a "@:", then this property was a build-time substitution that failed. Skip it | ||
size_t at = name.find("@", colon); | ||
if (at != colon + 1) { | ||
// Everything before the colon is the name, after is the value | ||
(*props)[name.substr(0, colon)] = name.substr(colon + 1); | ||
} | ||
} | ||
} | ||
|
||
static std::unordered_map<std::string, std::string>* LoadPropertiesSet() { | ||
auto * properties = new std::unordered_map<std::string, std::string>(); | ||
AddProperty(properties, rocksdb_build_git_sha); | ||
AddProperty(properties, rocksdb_build_git_tag); | ||
AddProperty(properties, rocksdb_build_date); | ||
return properties; | ||
} | ||
|
||
const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() { | ||
static std::unique_ptr<std::unordered_map<std::string, std::string>> props(LoadPropertiesSet()); | ||
return *props; | ||
} | ||
|
||
std::string GetRocksVersionAsString(bool with_patch) { | ||
std::string version = std::to_string(ROCKSDB_MAJOR) + "." + std::to_string(ROCKSDB_MINOR); | ||
if (with_patch) { | ||
return version + "." + std::to_string(ROCKSDB_PATCH); | ||
} else { | ||
return version; | ||
} | ||
} | ||
|
||
std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose) { | ||
std::string info = program + " (RocksDB) " + GetRocksVersionAsString(true); | ||
if (verbose) { | ||
for (const auto& it : GetRocksBuildProperties()) { | ||
info.append("\n "); | ||
info.append(it.first); | ||
info.append(": "); | ||
info.append(it.second); | ||
} | ||
} | ||
return info; | ||
} | ||
|
||
} // namespace ROCKSDB_NAMESPACE |
Submodule rocksdb
updated
from 09c7e9 to 19a876
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters