public interface JournalWriter<E> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
append(Indexed<E> entry)
Appends an indexed entry to the log.
|
<T extends E> |
append(T entry)
Appends an entry to the journal.
|
void |
close() |
void |
flush()
Flushes written entries to disk.
|
Indexed<E> |
getLastEntry()
Returns the last entry written.
|
long |
getLastIndex()
Returns the last written index.
|
long |
getNextIndex()
Returns the next index to be written.
|
void |
truncate(long index)
Truncates the log to the given index.
|
long getLastIndex()
Indexed<E> getLastEntry()
long getNextIndex()
<T extends E> Indexed<T> append(T entry)
entry - The entry to append.void append(Indexed<E> entry)
entry - The indexed entry to append.void truncate(long index)
index - The index to which to truncate the log.void flush()
void close()
close in interface AutoCloseableCopyright © 2013–2018. All rights reserved.