Package org.apache.flink.state.rocksdb
Class RocksIteratorWrapper
- java.lang.Object
-
- org.apache.flink.state.rocksdb.RocksIteratorWrapper
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.rocksdb.RocksIteratorInterface
- Direct Known Subclasses:
RocksTransformingIteratorWrapper
public class RocksIteratorWrapper extends Object implements org.rocksdb.RocksIteratorInterface, Closeable
This class was originally a wrapper aroundRocksIteratorto 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.
-
-
Constructor Summary
Constructors Constructor Description RocksIteratorWrapper(org.rocksdb.RocksIterator iterator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisValid()byte[]key()voidnext()voidprev()voidrefresh()voidseek(byte[] target)voidseek(ByteBuffer target)voidseekForPrev(byte[] target)voidseekForPrev(ByteBuffer target)voidseekToFirst()voidseekToLast()voidstatus()byte[]value()
-
-
-
Method Detail
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceorg.rocksdb.RocksIteratorInterface
-
seekToFirst
public void seekToFirst()
- Specified by:
seekToFirstin interfaceorg.rocksdb.RocksIteratorInterface
-
seekToLast
public void seekToLast()
- Specified by:
seekToLastin interfaceorg.rocksdb.RocksIteratorInterface
-
seek
public void seek(byte[] target)
- Specified by:
seekin interfaceorg.rocksdb.RocksIteratorInterface
-
seekForPrev
public void seekForPrev(byte[] target)
- Specified by:
seekForPrevin interfaceorg.rocksdb.RocksIteratorInterface
-
seek
public void seek(ByteBuffer target)
- Specified by:
seekin interfaceorg.rocksdb.RocksIteratorInterface
-
seekForPrev
public void seekForPrev(ByteBuffer target)
- Specified by:
seekForPrevin interfaceorg.rocksdb.RocksIteratorInterface
-
next
public void next()
- Specified by:
nextin interfaceorg.rocksdb.RocksIteratorInterface
-
prev
public void prev()
- Specified by:
previn interfaceorg.rocksdb.RocksIteratorInterface
-
status
public void status()
- Specified by:
statusin interfaceorg.rocksdb.RocksIteratorInterface
-
refresh
public void refresh() throws org.rocksdb.RocksDBException- Specified by:
refreshin interfaceorg.rocksdb.RocksIteratorInterface- Throws:
org.rocksdb.RocksDBException
-
key
public byte[] key()
-
value
public byte[] value()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-