Interface RaftLogReader

All Superinterfaces:
AutoCloseable, Iterator<IndexedRaftLogEntry>
All Known Implementing Classes:
RaftLogCommittedReader, RaftLogUncommittedReader

public interface RaftLogReader extends Iterator<IndexedRaftLogEntry>, AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    long
    Reset the reader to the first index of the log.
    long
    seek(long index)
    Seeks to the given index.
    long
    seekToAsqn(long asqn)
    Seek to a record with the highest ASQN less than or equal to the given asqn.
    long
    Seeks to the last index

    Methods inherited from interface java.util.Iterator

    forEachRemaining, hasNext, next, remove
  • Method Details

    • reset

      long reset()
      Reset the reader to the first index of the log.
      Returns:
      return the first index
    • seek

      long seek(long index)
      Seeks to the given index.
      Parameters:
      index - the index to seeks to
      Returns:
      the index of the next record to be read
    • seekToLast

      long seekToLast()
      Seeks to the last index
      Returns:
      the index of the next record to be read
    • seekToAsqn

      long seekToAsqn(long asqn)
      Seek to a record with the highest ASQN less than or equal to the given asqn.
      Parameters:
      asqn - the asqn to seek to
      Returns:
      the index of the record that will be returned by Iterator.next()
    • close

      void close()
      Specified by:
      close in interface AutoCloseable