Skip to content

Commit

Permalink
add DBIterator::SeekForPrev().
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Aug 22, 2022
1 parent 84a391a commit 7df88cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions leveldb-api/src/main/java/org/iq80/leveldb/DBIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public interface DBIterator
*/
void seek(byte[] key);

/**
* seek to the last key that is less than or equal to the target key.
* @url https://github.com/facebook/rocksdb/wiki/SeekForPrev
*/
void seekForPrev(byte[] key);

/**
* Repositions the iterator so is is at the beginning of the Database.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public void seek(byte[] targetKey)
seekingIterator.seek(Slices.wrappedBuffer(targetKey));
}

@Override
public void seekForPrev(byte[] targetKey)
{
throw new UnsupportedOperationException();
}

@Override
public boolean hasNext()
{
Expand Down

0 comments on commit 7df88cf

Please sign in to comment.