From 2c98b06bff6f4c23ed84eb8a76e8a7b16023edac Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Thu, 15 Jun 2017 16:08:32 -0700 Subject: [PATCH] Remove pin_slice option by making it the default Summary: This would simplify db_bench_tool.cc Closes https://github.com/facebook/rocksdb/pull/2457 Differential Revision: D5259035 Pulled By: maysamyabandeh fbshipit-source-id: 0a9c3abda624070fe2650200b885ad7e1c60182c --- tools/db_bench_tool.cc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 22492c546..1ecae9a49 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -235,8 +235,6 @@ DEFINE_bool(reverse_iterator, false, DEFINE_bool(use_uint64_comparator, false, "use Uint64 user comparator"); -DEFINE_bool(pin_slice, true, "use pinnable slice for point lookup"); - DEFINE_int64(batch_size, 1, "Batch size"); static bool ValidateKeySize(const char* flagname, int32_t value) { @@ -3993,7 +3991,6 @@ void VerifyDBFromDB(std::string& truth_db_name) { ReadOptions options(FLAGS_verify_checksum, true); std::unique_ptr key_guard; Slice key = AllocateKey(&key_guard); - std::string value; PinnableSlice pinnable_val; Duration duration(FLAGS_duration, reads_); @@ -4008,22 +4005,16 @@ void VerifyDBFromDB(std::string& truth_db_name) { Status s; if (FLAGS_num_column_families > 1) { s = db_with_cfh->db->Get(options, db_with_cfh->GetCfh(key_rand), key, - &value); + &pinnable_val); } else { - if (LIKELY(FLAGS_pin_slice == 1)) { - pinnable_val.Reset(); - s = db_with_cfh->db->Get(options, - db_with_cfh->db->DefaultColumnFamily(), key, - &pinnable_val); - } else { - s = db_with_cfh->db->Get( - options, db_with_cfh->db->DefaultColumnFamily(), key, &value); - } + pinnable_val.Reset(); + s = db_with_cfh->db->Get(options, + db_with_cfh->db->DefaultColumnFamily(), key, + &pinnable_val); } if (s.ok()) { found++; - bytes += key.size() + - (FLAGS_pin_slice == 1 ? pinnable_val.size() : value.size()); + bytes += key.size() + pinnable_val.size(); } else if (!s.IsNotFound()) { fprintf(stderr, "Get returned an error: %s\n", s.ToString().c_str()); abort();