Package org.rocksdb

Class TransactionLogIterator

All Implemented Interfaces:
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.

  • 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

      public void status() throws RocksDBException

      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.BatchResult instance.
    • disposeInternal

      protected final void disposeInternal(long handle)
      Specified by:
      disposeInternal in class RocksObject