public interface JournalWriter
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the journal.
|
void |
completeCurrentLog()
Marks the current log as completed.
|
void |
completeLogs()
Marks all logs as completed.
|
void |
deleteCompletedLogs()
Deletes all of the completed logs.
|
void |
flush()
Flushes the current log stream.
|
JournalOutputStream |
getCheckpointOutputStream(long latestSequenceNumber)
Returns an output stream for the journal checkpoint.
|
long |
getNextSequenceNumber() |
void |
recover()
Recovers the checkpoint in case the master crashed while updating it previously.
|
void |
write(Journal.JournalEntry entry)
Writes an entry to the current log stream.
|
void completeLogs() throws IOException
IOException
JournalOutputStream getCheckpointOutputStream(long latestSequenceNumber) throws IOException
latestSequenceNumber
- the sequence number of the latest journal entry. This sequence
number will be used to determine the next sequence numbers for the subsequent journal
entries.IOException
void write(Journal.JournalEntry entry) throws IOException
flush()
should be called
afterward to ensure the entry is persisted.entry
- the journal entry to writeIOException
void flush() throws IOException
IOException
long getNextSequenceNumber()
void close() throws IOException
IOException
void recover()
void deleteCompletedLogs() throws IOException
IOException
void completeCurrentLog() throws IOException
IOException
Copyright © 2023. All Rights Reserved.