public class DelegatingJournalWriter<E> extends Object implements JournalWriter<E>
| Constructor and Description |
|---|
DelegatingJournalWriter(JournalWriter<E> delegate) |
| 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.
|
String |
toString() |
void |
truncate(long index)
Truncates the log to the given index.
|
public DelegatingJournalWriter(JournalWriter<E> delegate)
public long getLastIndex()
JournalWritergetLastIndex in interface JournalWriter<E>public Indexed<E> getLastEntry()
JournalWritergetLastEntry in interface JournalWriter<E>public long getNextIndex()
JournalWritergetNextIndex in interface JournalWriter<E>public <T extends E> Indexed<T> append(T entry)
JournalWriterappend in interface JournalWriter<E>entry - The entry to append.public void append(Indexed<E> entry)
JournalWriterappend in interface JournalWriter<E>entry - The indexed entry to append.public void truncate(long index)
JournalWritertruncate in interface JournalWriter<E>index - The index to which to truncate the log.public void flush()
JournalWriterflush in interface JournalWriter<E>public void close()
close in interface JournalWriter<E>close in interface AutoCloseableCopyright © 2013–2018. All rights reserved.