Interface EntryJournal.Reader

All Superinterfaces:
AutoCloseable
Enclosing interface:
EntryJournal

public static interface EntryJournal.Reader extends AutoCloseable
A reader-side interface to log entries being stored in this journal.
  • Method Details

    • nextJournalIndex

      long nextJournalIndex()
      Returns Returns the journalIndex, guaranteed to be positive.
      Returns:
      Returns the journalIndex, guaranteed to be positive
    • nextEntry

      @Nullable EntryJournal.JournalEntry nextEntry() throws IOException
      Returns the next EntryJournal.JournalEntry, or null.
      Returns:
      the next EntryJournal.JournalEntry, or null
      Throws:
      IOException - if an I/O error occurs
    • resetToRead

      void resetToRead(long nextJournalIndex) throws IOException
      Reset this reader so it attempts to read the entry at specified journalIndex.
      Parameters:
      nextJournalIndex - the next journalIndex to read, must be positive
      Throws:
      IOException - if an I/O error occurs
    • close

      void close()
      Specified by:
      close in interface AutoCloseable