Package org.rocksdb
Class TransactionLogIterator
java.lang.Object
org.rocksdb.AbstractNativeReference
org.rocksdb.AbstractImmutableNativeReference
org.rocksdb.RocksObject
org.rocksdb.TransactionLogIterator
- All Implemented Interfaces:
AutoCloseable
A TransactionLogIterator is used to iterate over the transactions in a db. One run of the iterator is continuous, i.e. the iterator will stop at the beginning of any gap in sequences.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBatchResult represents a data structure returned by a TransactionLogIterator containing a sequence number and aWriteBatchinstance. -
Field Summary
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_ -
Method Summary
Modifier and TypeMethodDescriptionprotected final voiddisposeInternal(long handle) getBatch()If iterator position is valid, return the current write_batch and the sequence number of the earliest transaction contained in the batch.booleanisValid()An iterator is either positioned at a WriteBatch or not valid.voidnext()Moves the iterator to the next WriteBatch.voidstatus()Throws RocksDBException if something went wrong.Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandleMethods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Method Details
-
isValid
public boolean isValid()An iterator is either positioned at a WriteBatch or not valid. This method returns true if the iterator is valid. Can read data from a valid iterator.
- Returns:
- true if iterator position is valid.
-
next
public void next()Moves the iterator to the next WriteBatch. REQUIRES: Valid() to be true.
-
status
Throws RocksDBException if something went wrong.
- Throws:
RocksDBException- if something went wrong in the underlying C++ code.
-
getBatch
If iterator position is valid, return the current write_batch and the sequence number of the earliest transaction contained in the batch.
ONLY use if Valid() is true and status() is OK.
- Returns:
TransactionLogIterator.BatchResultinstance.
-
disposeInternal
protected final void disposeInternal(long handle) - Specified by:
disposeInternalin classRocksObject
-