Package io.atomix.raft.storage.log
Interface RaftLogReader
- All Superinterfaces:
AutoCloseable,Iterator<IndexedRaftLogEntry>
- All Known Implementing Classes:
RaftLogCommittedReader,RaftLogUncommittedReader
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longreset()Reset the reader to the first index of the log.longseek(long index) Seeks to the given index.longseekToAsqn(long asqn) Seek to a record with the highest ASQN less than or equal to the given asqn.longSeeks to the last indexMethods 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:
closein interfaceAutoCloseable
-