From 5c04610b9c2e3b1d115586b36b782f083036e5ab Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 28 Apr 2021 10:03:08 -0700 Subject: [PATCH] Fix CircleCI build failures --- cache/cache_bench_tool.cc | 13 ++----------- tools/db_bench_tool.cc | 4 ++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cache/cache_bench_tool.cc b/cache/cache_bench_tool.cc index e372907c6..62f31de1c 100644 --- a/cache/cache_bench_tool.cc +++ b/cache/cache_bench_tool.cc @@ -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 -int main() { - fprintf(stderr, "Please install gflags to run rocksdb tools\n"); - return 1; -} -#else - #include #include @@ -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 diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index b7265f7b8..98db70330 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -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 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( FLAGS_tiered_cache_uri, &tiered_cache); @@ -2807,6 +2810,7 @@ class Benchmark { } opts.tiered_cache = tiered_cache; } +#endif return NewLRUCache(opts); } }