Make Iterator::SeekForPrev pure virtual

Summary:
To prevent user who implement the Iterator interface fail to implement SeekForPrev by mistake.
Closes https://github.com/facebook/rocksdb/pull/3402

Differential Revision: D6790681

Pulled By: yiwu-arbug

fbshipit-source-id: bd75b8ced30208982e0a1414d34384d93496827a
main
Yi Wu 7 years ago committed by Facebook Github Bot
parent d46e832e94
commit 35d8e65a04
  1. 2
      HISTORY.md
  2. 2
      include/rocksdb/iterator.h

@ -1,5 +1,7 @@
# Rocksdb Change Log # Rocksdb Change Log
## Unreleased ## Unreleased
### Public API Change
* Iterator::SeekForPrev is now a pure virtual method. This is to prevent user who implement the Iterator interface fail to implement SeekForPrev by mistake.
### Bug Fixes ### Bug Fixes
* Fix `DisableFileDeletions()` followed by `GetSortedWalFiles()` to not return obsolete WAL files that `PurgeObsoleteFiles()` is going to delete. * Fix `DisableFileDeletions()` followed by `GetSortedWalFiles()` to not return obsolete WAL files that `PurgeObsoleteFiles()` is going to delete.
* Fix DB::Flush() keep waiting after flush finish under certain condition. * Fix DB::Flush() keep waiting after flush finish under certain condition.

@ -51,7 +51,7 @@ class Iterator : public Cleanable {
// Position at the last key in the source that at or before target // Position at the last key in the source that at or before target
// The iterator is Valid() after this call iff the source contains // The iterator is Valid() after this call iff the source contains
// an entry that comes at or before target. // an entry that comes at or before target.
virtual void SeekForPrev(const Slice& target) {} virtual void SeekForPrev(const Slice& target) = 0;
// Moves to the next entry in the source. After this call, Valid() is // Moves to the next entry in the source. After this call, Valid() is
// true iff the iterator was not positioned at the last entry in the source. // true iff the iterator was not positioned at the last entry in the source.

Loading…
Cancel
Save