@ThreadSafe public final class UfsJournalLogWriter extends Object implements JournalWriter
Constructor and Description |
---|
UfsJournalLogWriter(UfsJournal journal,
long nextSequenceNumber)
Creates a new instance of
UfsJournalLogWriter . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
Flushes all the entries written to the underlying storage.
|
long |
getNextSequenceNumber() |
void |
write(Journal.JournalEntry entry)
Writes an entry.
|
public UfsJournalLogWriter(UfsJournal journal, long nextSequenceNumber) throws IOException
UfsJournalLogWriter
.journal
- the handle to the journalnextSequenceNumber
- the sequence number to begin writing atIOException
public void write(Journal.JournalEntry entry) throws IOException, JournalClosedException
JournalWriter
JournalWriter.flush()
should be called afterwards if we want to make sure the entry
is persisted.write
in interface JournalWriter
entry
- the journal entry to writeIOException
JournalClosedException
public void flush() throws IOException, JournalClosedException
JournalWriter
flush
in interface JournalWriter
IOException
JournalClosedException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public long getNextSequenceNumber()
Copyright © 2023. All Rights Reserved.