Fix CircleCI build failures

This commit is contained in:
anand76 2021-04-28 10:03:08 -07:00
parent 8f0de0554f
commit 5c04610b9c
2 changed files with 6 additions and 11 deletions

View File

@ -3,14 +3,6 @@
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#ifndef GFLAGS
#include <cstdio>
int main() {
fprintf(stderr, "Please install gflags to run rocksdb tools\n");
return 1;
}
#else
#include <sys/types.h>
#include <cinttypes>
@ -197,7 +189,7 @@ void helperCallback(Cache::SizeCallback* size_cb,
Cache::SaveToCallback* save_cb,
Cache::DeletionCallback* del_cb) {
if (size_cb) {
*size_cb = [](void* /*obj*/) -> size_t { return FLAGS_value_bytes; };
*size_cb = [](void * /*obj*/) -> size_t { return FLAGS_value_bytes; };
}
if (save_cb) {
*save_cb = [](void* obj, size_t /*offset*/, size_t size,
@ -236,9 +228,9 @@ class CacheBench {
exit(1);
}
max_log_ = 0;
if (skewed_) {
uint64_t max_key = max_key_;
max_log_ = 0;
while (max_key >>= 1) max_log_++;
if (max_key > (1u << max_log_)) max_log_++;
}
@ -503,4 +495,3 @@ int cache_bench_tool(int argc, char** argv) {
}
} // namespace ROCKSDB_NAMESPACE
#endif // GFLAGS

View File

@ -1414,9 +1414,11 @@ DEFINE_bool(read_with_latest_user_timestamp, true,
"If true, always use the current latest timestamp for read. If "
"false, choose a random timestamp from the past.");
#ifndef ROCKSDB_LITE
DEFINE_string(tiered_cache_uri, "",
"Full URI for creating a custom tiered cache object");
static class std::shared_ptr<ROCKSDB_NAMESPACE::TieredCache> tiered_cache;
#endif
static const bool FLAGS_soft_rate_limit_dummy __attribute__((__unused__)) =
RegisterFlagValidator(&FLAGS_soft_rate_limit, &ValidateRateLimit);
@ -2796,6 +2798,7 @@ class Benchmark {
exit(1);
#endif
}
#ifndef ROCKSDB_LITE
if (!FLAGS_tiered_cache_uri.empty()) {
Status s = ObjectRegistry::NewInstance()->NewSharedObject<TieredCache>(
FLAGS_tiered_cache_uri, &tiered_cache);
@ -2807,6 +2810,7 @@ class Benchmark {
}
opts.tiered_cache = tiered_cache;
}
#endif
return NewLRUCache(opts);
}
}