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. At that time, this was required because the
iterator may pass the blocks or files it had difficulties in reading (because of IO errors, data
corruptions or other issues) and continue with the next available keys. The status flag may not
be OK, even if the iterator is valid.
However, after 3810 was merged, the behaviour had changed. If the iterator is valid, the status() is guaranteed to be OK; If the iterator is not valid, there are two possibilities: 1) We have reached the end of the data. And in this case, status() is OK; 2) There is an error. In this case, status() is not OK; More information can be found here.
| 构造器和说明 |
|---|
RocksIteratorWrapper(org.rocksdb.RocksIterator iterator) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
boolean |
isValid() |
byte[] |
key() |
void |
next() |
void |
prev() |
void |
refresh() |
void |
seek(byte[] target) |
void |
seek(ByteBuffer target) |
void |
seekForPrev(byte[] target) |
void |
seekForPrev(ByteBuffer target) |
void |
seekToFirst() |
void |
seekToLast() |
void |
status() |
byte[] |
value() |
public RocksIteratorWrapper(@Nonnull org.rocksdb.RocksIterator iterator)
public boolean isValid()
isValid 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seekToFirst()
seekToFirst 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seekToLast()
seekToLast 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seek(byte[] target)
seek 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seekForPrev(byte[] target)
seekForPrev 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seek(ByteBuffer target)
seek 在接口中 org.rocksdb.RocksIteratorInterfacepublic void seekForPrev(ByteBuffer target)
seekForPrev 在接口中 org.rocksdb.RocksIteratorInterfacepublic void next()
next 在接口中 org.rocksdb.RocksIteratorInterfacepublic void prev()
prev 在接口中 org.rocksdb.RocksIteratorInterfacepublic void status()
status 在接口中 org.rocksdb.RocksIteratorInterfacepublic void refresh()
throws org.rocksdb.RocksDBException
refresh 在接口中 org.rocksdb.RocksIteratorInterfaceorg.rocksdb.RocksDBExceptionpublic byte[] key()
public byte[] value()
public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.