From 74b660702e095d3a6f6da2954efb3f7be9105f78 Mon Sep 17 00:00:00 2001 From: sdong Date: Tue, 1 Mar 2016 12:56:21 -0800 Subject: [PATCH] Rename iterator property "rocksdb.iterator.is.key.pinned" => "rocksdb.iterator.is-key-pinned" Summary: Rename iterator property to folow property naming convention. Test Plan: Run all existing tests. Reviewers: andrewkr, anthony, yhchiang, kradhakrishnan, IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D54957 --- db/db_iter.cc | 2 +- db/db_test.cc | 16 ++++++++-------- include/rocksdb/iterator.h | 2 +- include/rocksdb/options.h | 2 +- table/iterator.cc | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/db/db_iter.cc b/db/db_iter.cc index c051a3928..4f4317f9a 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -142,7 +142,7 @@ class DBIter: public Iterator { if (prop == nullptr) { return Status::InvalidArgument("prop is nullptr"); } - if (prop_name == "rocksdb.iterator.is.key.pinned") { + if (prop_name == "rocksdb.iterator.is-key-pinned") { if (valid_) { *prop = (iter_pinned_ && saved_key_.IsKeyPinned()) ? "1" : "0"; } else { diff --git a/db/db_test.cc b/db/db_test.cc index de9bf8209..d68087d13 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -644,10 +644,10 @@ TEST_F(DBTest, IteratorProperty) { iter->SeekToFirst(); std::string prop_value; ASSERT_NOK(iter->GetProperty("non_existing.value", &prop_value)); - ASSERT_OK(iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + ASSERT_OK(iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("0", prop_value); iter->Next(); - ASSERT_OK(iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + ASSERT_OK(iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("Iterator is not valid.", prop_value); } Close(); @@ -9864,7 +9864,7 @@ TEST_F(DBTest, PinnedDataIteratorRandomized) { } std::string prop_value; ASSERT_OK( - iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); keys_slices.push_back(iter->key()); true_keys.push_back(true_data.lower_bound(k)->first); @@ -9882,7 +9882,7 @@ TEST_F(DBTest, PinnedDataIteratorRandomized) { for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { std::string prop_value; ASSERT_OK( - iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); all_keys.push_back(iter->key()); } @@ -9903,7 +9903,7 @@ TEST_F(DBTest, PinnedDataIteratorRandomized) { for (iter->SeekToLast(); iter->Valid(); iter->Prev()) { std::string prop_value; ASSERT_OK( - iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); all_keys.push_back(iter->key()); } @@ -9976,7 +9976,7 @@ TEST_F(DBTest, PinnedDataIteratorMultipleFiles) { std::vector> results; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { std::string prop_value; - ASSERT_OK(iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + ASSERT_OK(iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); results.emplace_back(iter->key(), iter->value().ToString()); } @@ -10031,7 +10031,7 @@ TEST_F(DBTest, PinnedDataIteratorMergeOperator) { std::vector> results; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { std::string prop_value; - ASSERT_OK(iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + ASSERT_OK(iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); results.emplace_back(iter->key(), iter->value().ToString()); } @@ -10088,7 +10088,7 @@ TEST_F(DBTest, PinnedDataIteratorReadAfterUpdate) { std::vector> results; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { std::string prop_value; - ASSERT_OK(iter->GetProperty("rocksdb.iterator.is.key.pinned", &prop_value)); + ASSERT_OK(iter->GetProperty("rocksdb.iterator.is-key-pinned", &prop_value)); ASSERT_EQ("1", prop_value); results.emplace_back(iter->key(), iter->value().ToString()); } diff --git a/include/rocksdb/iterator.h b/include/rocksdb/iterator.h index 4d9b9b89a..2cd107f43 100644 --- a/include/rocksdb/iterator.h +++ b/include/rocksdb/iterator.h @@ -96,7 +96,7 @@ class Iterator : public Cleanable { // satisfied without doing some IO, then this returns Status::Incomplete(). virtual Status status() const = 0; - // Property "rocksdb.iterator.is.key.pinned": + // Property "rocksdb.iterator.is-key-pinned": // If returning "1", this means that the Slice returned by key() is valid // as long as the iterator is not deleted and ReleasePinnedData() is not // called. diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 9dbb5bbe8..6ace73bb6 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -1400,7 +1400,7 @@ struct ReadOptions { // Keep the blocks loaded by the iterator pinned in memory as long as the // iterator is not deleted, If used when reading from tables created with // BlockBasedTableOptions::use_delta_encoding = false, - // Iterator's property "rocksdb.iterator.is.key.pinned" is guaranteed to + // Iterator's property "rocksdb.iterator.is-key-pinned" is guaranteed to // return 1. // Default: false bool pin_data; diff --git a/table/iterator.cc b/table/iterator.cc index 0b53b41aa..09f7f8e68 100644 --- a/table/iterator.cc +++ b/table/iterator.cc @@ -50,7 +50,7 @@ Status Iterator::GetProperty(std::string prop_name, std::string* prop) { if (prop == nullptr) { return Status::InvalidArgument("prop is nullptr"); } - if (prop_name == "rocksdb.iterator.is.key.pinned") { + if (prop_name == "rocksdb.iterator.is-key-pinned") { *prop = "0"; return Status::OK(); }