Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into set_zstd_max_train_bytes
- Loading branch information
Showing
12 changed files
with
281 additions
and
86 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
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
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,62 @@ | ||
#include "build_version.h" | ||
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@09c7e96eac1ab983f97ce9e0406730b8014b3398@"; | ||
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2021/02/18 09:36:23@"; | ||
const char* rocksdb_build_compile_date = __DATE__; | ||
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
|
||
#include <memory> | ||
|
||
#include "rocksdb/version.h" | ||
#include "util/string_util.h" | ||
|
||
// The build script may replace these values with real values based | ||
// on whether or not GIT is available and the platform settings | ||
static const std::string rocksdb_build_git_sha = "rocksdb_build_git_sha:645c445978bb22c8c7791f90a0d9931928a58045"; | ||
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:master"; | ||
static const std::string rocksdb_build_date = "rocksdb_build_date:2021-04-19 19:57:42"; | ||
|
||
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 = ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR); | ||
if (with_patch) { | ||
return version + "." + ToString(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 | ||
|
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.