Package io.atomix.storage.journal
Interface JournalWriter<E>
public interface JournalWriter<E>
Log writer.
- Author:
- Jordan Halterman
-
Method Summary
Modifier and TypeMethodDescriptionappend(T entry) Appends an entry to the journal.voidcommit(long index) Commits entries up to the given index.voidflush()Flushes written entries to disk.longReturns the next index to be written.voidreset(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
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.
-