From d88dff4ef2052cfb031128da9f4dc3be25872d68 Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Mon, 17 Oct 2016 15:34:13 -0700 Subject: [PATCH] add seeforprev in history Summary: update new feature in history and avoid breaking mongorocks Test Plan: make check Reviewers: sdong, yiwu, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D64611 --- HISTORY.md | 3 +++ include/rocksdb/iterator.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 3857eac81..79f9b2060 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,9 @@ ### New Features * Add DB::SetDBOptions() to dynamic change base_background_compactions and max_background_compactions. +### New Features +* Added Iterator::SeekForPrev(). This new API will seek to the last key that less than or equal to the target key. + ## 4.12.0 (9/12/2016) ### Public API Change * CancelAllBackgroundWork() flushes all memtables for databases containing writes that have bypassed the WAL (writes issued with WriteOptions::disableWAL=true) before shutting down background threads. diff --git a/include/rocksdb/iterator.h b/include/rocksdb/iterator.h index 9d935b627..afc98d22b 100644 --- a/include/rocksdb/iterator.h +++ b/include/rocksdb/iterator.h @@ -72,7 +72,7 @@ class Iterator : public Cleanable { // Position at the last key in the source that at or before target // The iterator is Valid() after this call iff the source contains // an entry that comes at or before target. - virtual void SeekForPrev(const Slice& target) = 0; + virtual void SeekForPrev(const Slice& target) {} // 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.