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