public final class JournalUtils extends Object
Modifier and Type | Method and Description |
---|---|
static URI |
getJournalLocation()
Returns a URI for the configured location for the specified journal.
|
static void |
handleJournalReplayFailure(org.slf4j.Logger logger,
Throwable t,
String format,
Object... args)
Logs a fatal error and exits the system if required.
|
static void |
restoreFromCheckpoint(CheckpointInputStream input,
List<? extends Checkpointed> components)
Restores the given checkpointed components from a composite checkpoint.
|
static void |
restoreJournalEntryCheckpoint(CheckpointInputStream input,
Journaled journaled)
Restores the given journaled object from the journal entries in the input stream.
|
static void |
sinkAppend(java.util.function.Supplier<Set<JournalSink>> journalSinks,
Journal.JournalEntry entry)
Appends a journal entry to all the supplied journal sinks.
|
static void |
sinkFlush(java.util.function.Supplier<Set<JournalSink>> journalSinks)
Appends a flush to all the supplied journal sinks.
|
static void |
writeJournalEntryCheckpoint(OutputStream output,
JournalEntryIterable iterable)
Writes a checkpoint of the entries in the given iterable.
|
static void |
writeToCheckpoint(OutputStream output,
List<? extends Checkpointed> components)
Writes a composite checkpoint for the given checkpointed components.
|
public static URI getJournalLocation()
public static void writeJournalEntryCheckpoint(OutputStream output, JournalEntryIterable iterable) throws IOException, InterruptedException
restoreJournalEntryCheckpoint(CheckpointInputStream, Journaled)
.output
- the stream to write toiterable
- the iterable for fetching journal entriesIOException
InterruptedException
public static void restoreJournalEntryCheckpoint(CheckpointInputStream input, Journaled journaled) throws IOException
writeJournalEntryCheckpoint(OutputStream, JournalEntryIterable)
.input
- the stream to read fromjournaled
- the object to restoreIOException
public static void writeToCheckpoint(OutputStream output, List<? extends Checkpointed> components) throws IOException, InterruptedException
restoreFromCheckpoint(CheckpointInputStream, List)
.output
- the stream to write tocomponents
- the components to checkpointIOException
InterruptedException
public static void restoreFromCheckpoint(CheckpointInputStream input, List<? extends Checkpointed> components) throws IOException
writeToCheckpoint(OutputStream, List)
.input
- the stream to read fromcomponents
- the components to restoreIOException
public static void handleJournalReplayFailure(org.slf4j.Logger logger, Throwable t, String format, Object... args) throws RuntimeException
logger
- the logger to log tot
- the throwable causing the fatal errorformat
- the error message format stringargs
- args for the format stringRuntimeException
public static void sinkAppend(java.util.function.Supplier<Set<JournalSink>> journalSinks, Journal.JournalEntry entry)
journalSinks
- a supplier of journal sinksentry
- the journal entrypublic static void sinkFlush(java.util.function.Supplier<Set<JournalSink>> journalSinks)
journalSinks
- a supplier of journal sinksCopyright © 2023. All Rights Reserved.