Rename one of the two LevelIterator

Summary:
A new LevelIterator was recently created. Rename the old one to make unity build happy. It's also not a good idea to have two classes in the same name anyway.
Closes https://github.com/facebook/rocksdb/pull/3499

Differential Revision: D6979325

Pulled By: siying

fbshipit-source-id: 3a032d93fe205650a08e92e5262594731ec726bb
This commit is contained in:
Siying Dong 2018-02-13 13:44:22 -08:00 committed by Facebook Github Bot
parent 74748611a8
commit dadf01672a
2 changed files with 13 additions and 13 deletions

View File

@ -25,15 +25,15 @@
namespace rocksdb { namespace rocksdb {
// Usage: // Usage:
// LevelIterator iter; // ForwardLevelIterator iter;
// iter.SetFileIndex(file_index); // iter.SetFileIndex(file_index);
// iter.Seek(target); // iter.Seek(target);
// iter.Next() // iter.Next()
class LevelIterator : public InternalIterator { class ForwardLevelIterator : public InternalIterator {
public: public:
LevelIterator(const ColumnFamilyData* const cfd, ForwardLevelIterator(const ColumnFamilyData* const cfd,
const ReadOptions& read_options, const ReadOptions& read_options,
const std::vector<FileMetaData*>& files) const std::vector<FileMetaData*>& files)
: cfd_(cfd), : cfd_(cfd),
read_options_(read_options), read_options_(read_options),
files_(files), files_(files),
@ -42,7 +42,7 @@ class LevelIterator : public InternalIterator {
file_iter_(nullptr), file_iter_(nullptr),
pinned_iters_mgr_(nullptr) {} pinned_iters_mgr_(nullptr) {}
~LevelIterator() { ~ForwardLevelIterator() {
// Reset current pointer // Reset current pointer
if (pinned_iters_mgr_ && pinned_iters_mgr_->PinningEnabled()) { if (pinned_iters_mgr_ && pinned_iters_mgr_->PinningEnabled()) {
pinned_iters_mgr_->PinIterator(file_iter_); pinned_iters_mgr_->PinIterator(file_iter_);
@ -84,11 +84,11 @@ class LevelIterator : public InternalIterator {
} }
} }
void SeekToLast() override { void SeekToLast() override {
status_ = Status::NotSupported("LevelIterator::SeekToLast()"); status_ = Status::NotSupported("ForwardLevelIterator::SeekToLast()");
valid_ = false; valid_ = false;
} }
void Prev() override { void Prev() override {
status_ = Status::NotSupported("LevelIterator::Prev()"); status_ = Status::NotSupported("ForwardLevelIterator::Prev()");
valid_ = false; valid_ = false;
} }
bool Valid() const override { bool Valid() const override {
@ -105,7 +105,7 @@ class LevelIterator : public InternalIterator {
valid_ = file_iter_->Valid(); valid_ = file_iter_->Valid();
} }
void SeekForPrev(const Slice& internal_key) override { void SeekForPrev(const Slice& internal_key) override {
status_ = Status::NotSupported("LevelIterator::SeekForPrev()"); status_ = Status::NotSupported("ForwardLevelIterator::SeekForPrev()");
valid_ = false; valid_ = false;
} }
void Next() override { void Next() override {
@ -561,7 +561,7 @@ void ForwardIterator::UpdateChildrenPinnedItersMgr() {
} }
// Set PinnedIteratorsManager for L1+ levels iterators. // Set PinnedIteratorsManager for L1+ levels iterators.
for (LevelIterator* child_iter : level_iters_) { for (ForwardLevelIterator* child_iter : level_iters_) {
if (child_iter) { if (child_iter) {
child_iter->SetPinnedItersMgr(pinned_iters_mgr_); child_iter->SetPinnedItersMgr(pinned_iters_mgr_);
} }
@ -723,7 +723,7 @@ void ForwardIterator::BuildLevelIterators(const VersionStorageInfo* vstorage) {
} }
} else { } else {
level_iters_.push_back( level_iters_.push_back(
new LevelIterator(cfd_, read_options_, level_files)); new ForwardLevelIterator(cfd_, read_options_, level_files));
} }
} }
} }

View File

@ -23,7 +23,7 @@ class DBImpl;
class Env; class Env;
struct SuperVersion; struct SuperVersion;
class ColumnFamilyData; class ColumnFamilyData;
class LevelIterator; class ForwardLevelIterator;
class VersionStorageInfo; class VersionStorageInfo;
struct FileMetaData; struct FileMetaData;
@ -126,7 +126,7 @@ class ForwardIterator : public InternalIterator {
InternalIterator* mutable_iter_; InternalIterator* mutable_iter_;
std::vector<InternalIterator*> imm_iters_; std::vector<InternalIterator*> imm_iters_;
std::vector<InternalIterator*> l0_iters_; std::vector<InternalIterator*> l0_iters_;
std::vector<LevelIterator*> level_iters_; std::vector<ForwardLevelIterator*> level_iters_;
InternalIterator* current_; InternalIterator* current_;
bool valid_; bool valid_;