Class RaftLogUncommittedReader

java.lang.Object
io.atomix.raft.storage.log.RaftLogUncommittedReader
All Implemented Interfaces:
RaftLogReader, AutoCloseable, Iterator<IndexedRaftLogEntry>

public class RaftLogUncommittedReader extends Object implements RaftLogReader
Raft log reader that reads both committed and uncommitted entries. This reader is supposed to be only used internally in raft. The reader is not thread safe with a concurrent writer.
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<IndexedRaftLogEntry>
    • next

      public IndexedRaftLogEntry next()
      Specified by:
      next in interface Iterator<IndexedRaftLogEntry>
    • reset

      public long reset()
      Description copied from interface: RaftLogReader
      Reset the reader to the first index of the log.
      Specified by:
      reset in interface RaftLogReader
      Returns:
      return the first index
    • seek

      public long seek(long index)
      Description copied from interface: RaftLogReader
      Seeks to the given index.
      Specified by:
      seek in interface RaftLogReader
      Parameters:
      index - the index to seeks to
      Returns:
      the index of the next record to be read
    • seekToLast

      public long seekToLast()
      Description copied from interface: RaftLogReader
      Seeks to the last index
      Specified by:
      seekToLast in interface RaftLogReader
      Returns:
      the index of the next record to be read
    • seekToAsqn

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

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface RaftLogReader
    • seekToAsqn

      public long seekToAsqn(long asqn, long indexUpperBound)