@ThreadSafe public final class AsyncJournalWriter extends Object
Constructor and Description |
---|
AsyncJournalWriter(JournalWriter journalWriter,
java.util.function.Supplier<Set<JournalSink>> journalSinks)
Creates a
AsyncJournalWriter . |
AsyncJournalWriter(JournalWriter journalWriter,
java.util.function.Supplier<Set<JournalSink>> journalSinks,
String journalName)
Creates a
AsyncJournalWriter . |
Modifier and Type | Method and Description |
---|---|
long |
appendEntry(Journal.JournalEntry entry)
Appends a
Journal.JournalEntry for writing to the journal. |
void |
close()
Closes the async writer.
|
void |
flush(long targetCounter)
Submits a ticket to flush thread and waits until ticket is served.
|
protected void |
start() |
protected void |
stop() |
public AsyncJournalWriter(JournalWriter journalWriter, java.util.function.Supplier<Set<JournalSink>> journalSinks)
AsyncJournalWriter
.journalWriter
- a journal writer to write tojournalSinks
- a supplier for journal sinkspublic AsyncJournalWriter(JournalWriter journalWriter, java.util.function.Supplier<Set<JournalSink>> journalSinks, String journalName)
AsyncJournalWriter
.journalWriter
- a journal writer to write tojournalSinks
- a supplier for journal sinksjournalName
- the journal source namepublic long appendEntry(Journal.JournalEntry entry)
Journal.JournalEntry
for writing to the journal.entry
- the Journal.JournalEntry
to appendpublic void close()
protected void stop()
protected void start()
public void flush(long targetCounter) throws IOException, JournalClosedException
targetCounter
- the counter to flushIOException
JournalClosedException
Copyright © 2023. All Rights Reserved.