Interface EntryReader

All Superinterfaces:
AutoCloseable

@NonNullByDefault public interface EntryReader extends AutoCloseable
A reader of RaftJournal entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    long
    Returns the next reader index.
    void
    Resets the reader to the start.
    void
    reset(long index)
    Resets the reader to the given index.
    <T> @Nullable T
    Try to move to the next binary data block.
  • Method Details

    • nextIndex

      long nextIndex()
      Returns the next reader index.
      Returns:
      The next reader index
    • tryNext

      <T> @Nullable T tryNext(FromByteBufMapper<T> mapper)
      Try to move to the next binary data block.
      Type Parameters:
      T - Internal representation type
      Parameters:
      mapper - callback to be invoked on binary data
      Returns:
      processed binary data, or null
    • reset

      void reset()
      Resets the reader to the start.
    • reset

      void reset(long index)
      Resets the reader to the given index.
      Parameters:
      index - the next index to read
    • close

      void close()
      Specified by:
      close in interface AutoCloseable