@ -25,15 +25,15 @@
namespace rocksdb {
namespace rocksdb {
// Usage:
// Usage:
// LevelIterator iter;
// Forward LevelIterator iter;
// iter.SetFileIndex(file_index);
// iter.SetFileIndex(file_index);
// iter.Seek(target);
// iter.Seek(target);
// iter.Next()
// iter.Next()
class LevelIterator : public InternalIterator {
class Forward LevelIterator : public InternalIterator {
public :
public :
LevelIterator ( const ColumnFamilyData * const cfd ,
Forward LevelIterator( 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 ( ) {
~ Forward LevelIterator( ) {
// 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 ( " Forward LevelIterator::SeekToLast()" ) ;
valid_ = false ;
valid_ = false ;
}
}
void Prev ( ) override {
void Prev ( ) override {
status_ = Status : : NotSupported ( " LevelIterator::Prev() " ) ;
status_ = Status : : NotSupported ( " Forward LevelIterator::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 ( " Forward LevelIterator::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 ( Forward LevelIterator* 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 Forward LevelIterator( cfd_ , read_options_ , level_files ) ) ;
}
}
}
}
}
}