Package org.rocksdb
Class TransactionLogIterator
- java.lang.Object
-
- org.rocksdb.AbstractNativeReference
-
- org.rocksdb.AbstractImmutableNativeReference
-
- org.rocksdb.RocksObject
-
- org.rocksdb.TransactionLogIterator
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class TransactionLogIterator extends RocksObject
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 Classes Modifier and Type Class Description static classTransactionLogIterator.BatchResultBatchResult 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisposeInternal(long handle)TransactionLogIterator.BatchResultgetBatch()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, getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Method Detail
-
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
public void status() throws RocksDBExceptionThrows RocksDBException if something went wrong.
- Throws:
RocksDBException- if something went wrong in the underlying C++ code.
-
getBatch
public TransactionLogIterator.BatchResult 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
-
-