Interface JournalWriter<E>


public interface JournalWriter<E>
Log writer.
Author:
Jordan Halterman
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends E>
    @NonNull Indexed<T>
    append(T entry)
    Appends an entry to the journal.
    void
    commit(long index)
    Commits entries up to the given index.
    void
    Flushes written entries to disk.
    long
    Returns the next index to be written.
    void
    reset(long index)
    Resets the head of the journal to the given index.
  • Method Details

    • getNextIndex

      long getNextIndex()
      Returns the next index to be written.
      Returns:
      The next index to be written.
    • append

      <T extends E> @NonNull Indexed<T> append(T entry)
      Appends an entry to the journal.
      Parameters:
      entry - The entry to append.
      Returns:
      The appended indexed entry.
    • commit

      void commit(long index)
      Commits entries up to the given index.
      Parameters:
      index - The index up to which to commit entries.
    • reset

      void reset(long index)
      Resets the head of the journal to the given index.
      Parameters:
      index - the next index to write
      Throws:
      IndexOutOfBoundsException - if the journal cannot be reset to specified index
    • flush

      void flush()
      Flushes written entries to disk.