]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fixing build issue
authorAnurag Indu <aindu@aindu-mbp.local>
Tue, 24 Mar 2015 22:06:09 +0000 (15:06 -0700)
committerAnurag Indu <aindu@aindu-mbp.local>
Tue, 24 Mar 2015 23:27:24 +0000 (16:27 -0700)
Summary: Fixing issues with get context function.

Test Plan: Run make commit-prereq

Reviewers: sdong, meyering, yhchiang

Reviewed By: sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D35853

table/cuckoo_table_reader_test.cc
table/get_context.cc

index 1bafdd0b9d80d26ea6b520c5b9bb9d9720e716ca..660261ab35bf1ff688cefccaf646790a01a86a09 100644 (file)
@@ -124,7 +124,7 @@ class CuckooReaderTest : public testing::Test {
       std::string value;
       GetContext get_context(ucomp, nullptr, nullptr, nullptr,
                              GetContext::kNotFound, Slice(user_keys[i]), &value,
-                             nullptr, nullptr);
+                             nullptr, nullptr, nullptr);
       ASSERT_OK(reader.Get(ReadOptions(), Slice(keys[i]), &get_context));
       ASSERT_EQ(values[i], value);
     }
@@ -337,7 +337,8 @@ TEST_F(CuckooReaderTest, WhenKeyNotFound) {
   AppendInternalKey(&not_found_key, ikey);
   std::string value;
   GetContext get_context(ucmp, nullptr, nullptr, nullptr, GetContext::kNotFound,
-                         Slice(not_found_key), &value, nullptr, nullptr);
+                         Slice(not_found_key), &value, nullptr, nullptr,
+                         nullptr);
   ASSERT_OK(reader.Get(ReadOptions(), Slice(not_found_key), &get_context));
   ASSERT_TRUE(value.empty());
   ASSERT_OK(reader.status());
@@ -349,7 +350,7 @@ TEST_F(CuckooReaderTest, WhenKeyNotFound) {
   AppendInternalKey(&not_found_key2, ikey2);
   GetContext get_context2(ucmp, nullptr, nullptr, nullptr,
                           GetContext::kNotFound, Slice(not_found_key2), &value,
-                          nullptr, nullptr);
+                          nullptr, nullptr, nullptr);
   ASSERT_OK(reader.Get(ReadOptions(), Slice(not_found_key2), &get_context2));
   ASSERT_TRUE(value.empty());
   ASSERT_OK(reader.status());
@@ -363,7 +364,7 @@ TEST_F(CuckooReaderTest, WhenKeyNotFound) {
       kNumHashFunc, kNumHashFunc);
   GetContext get_context3(ucmp, nullptr, nullptr, nullptr,
                           GetContext::kNotFound, Slice(unused_key), &value,
-                          nullptr, nullptr);
+                          nullptr, nullptr, nullptr);
   ASSERT_OK(reader.Get(ReadOptions(), Slice(unused_key), &get_context3));
   ASSERT_TRUE(value.empty());
   ASSERT_OK(reader.status());
@@ -434,7 +435,7 @@ void WriteFile(const std::vector<std::string>& keys,
   std::string value;
   // Assume only the fast path is triggered
   GetContext get_context(nullptr, nullptr, nullptr, nullptr,
-                         GetContext::kNotFound, Slice(), &value,
+                         GetContext::kNotFound, Slice(), &value, nullptr,
                          nullptr, nullptr);
   for (uint64_t i = 0; i < num; ++i) {
     value.clear();
@@ -480,7 +481,7 @@ void ReadKeys(uint64_t num, uint32_t batch_size) {
   std::string value;
   // Assume only the fast path is triggered
   GetContext get_context(nullptr, nullptr, nullptr, nullptr,
-                         GetContext::kNotFound, Slice(), &value,
+                         GetContext::kNotFound, Slice(), &value, nullptr,
                          nullptr, nullptr);
   uint64_t start_time = env->NowMicros();
   if (batch_size > 0) {
index 737b3660ea0ba6e38e5c1e43bd9a9860094897a5..e83aa1d86312b23e1b5729035c06eb701aa4038a 100644 (file)
@@ -68,7 +68,7 @@ bool GetContext::SaveValue(const ParsedInternalKey& parsed_key,
                 user_key_, &value, merge_context_->GetOperands(), value_,
                 logger_);
             RecordTick(statistics_, MERGE_OPERATION_TOTAL_TIME,
-                       timer.ElapsedNanos());
+                       env_ != nullptr ? timer.ElapsedNanos() : 0);
           }
           if (!merge_success) {
             RecordTick(statistics_, NUMBER_MERGE_FAILURES);
@@ -91,7 +91,7 @@ bool GetContext::SaveValue(const ParsedInternalKey& parsed_key,
                 user_key_, nullptr, merge_context_->GetOperands(), value_,
                 logger_);
             RecordTick(statistics_, MERGE_OPERATION_TOTAL_TIME,
-                       timer.ElapsedNanos());
+                       env_ != nullptr ? timer.ElapsedNanos() : 0);
           }
           if (!merge_success) {
             RecordTick(statistics_, NUMBER_MERGE_FAILURES);