public class RocksIteratorWrapper extends Object implements org.rocksdb.RocksIteratorInterface, Closeable
RocksIterator
to check the iterator status for all the methods mentioned
to require this check in the wiki documentation: seek, next, seekToFirst, seekToLast, seekForPrev, and prev.
This is required because the iterator may pass the blocks or files it had difficulties in reading (because
of IO error, data corruption or other issues) and continue with the next available keys. The status flag may not be
OK, even if the iterator is valid. More information can be found
here.Constructor and Description |
---|
RocksIteratorWrapper(org.rocksdb.RocksIterator iterator) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isValid() |
byte[] |
key() |
void |
next() |
void |
prev() |
void |
seek(byte[] target) |
void |
seekForPrev(byte[] target) |
void |
seekToFirst() |
void |
seekToLast() |
void |
status() |
byte[] |
value() |
public RocksIteratorWrapper(@Nonnull org.rocksdb.RocksIterator iterator)
public boolean isValid()
isValid
in interface org.rocksdb.RocksIteratorInterface
public void seekToFirst()
seekToFirst
in interface org.rocksdb.RocksIteratorInterface
public void seekToLast()
seekToLast
in interface org.rocksdb.RocksIteratorInterface
public void seek(byte[] target)
seek
in interface org.rocksdb.RocksIteratorInterface
public void seekForPrev(byte[] target)
seekForPrev
in interface org.rocksdb.RocksIteratorInterface
public void next()
next
in interface org.rocksdb.RocksIteratorInterface
public void prev()
prev
in interface org.rocksdb.RocksIteratorInterface
public void status()
status
in interface org.rocksdb.RocksIteratorInterface
public byte[] key()
public byte[] value()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.