public interface DelegatingJournaled extends Journaled
LOG
Modifier and Type | Method and Description |
---|---|
default void |
applyAndJournal(java.util.function.Supplier<JournalContext> context,
Journal.JournalEntry entry)
Applies and journals a journal entry.
|
default CheckpointName |
getCheckpointName() |
Journaled |
getDelegate() |
default CloseableIterator<Journal.JournalEntry> |
getJournalEntryIterator() |
default boolean |
processJournalEntry(Journal.JournalEntry entry)
Attempts to apply a journal entry.
|
default void |
resetState()
Resets the object's journaled state.
|
default void |
restoreFromCheckpoint(CheckpointInputStream input)
Restores state from a checkpoint.
|
default CompletableFuture<Void> |
restoreFromCheckpoint(File directory,
ExecutorService executorService)
Restores state from a checkpoint asynchronously.
|
default CompletableFuture<Void> |
writeToCheckpoint(File directory,
ExecutorService executorService)
Writes a checkpoint to the specified directory asynchronously using the provided executor.
|
default void |
writeToCheckpoint(OutputStream output)
Writes a checkpoint of all state to the given output stream.
|
default boolean processJournalEntry(Journal.JournalEntry entry)
Journaled
processJournalEntry
in interface Journaled
entry
- the entry to applydefault void resetState()
Journaled
resetState
in interface Journaled
default void applyAndJournal(java.util.function.Supplier<JournalContext> context, Journal.JournalEntry entry)
Journaled
applyAndJournal
in interface Journaled
context
- journal contextentry
- the entry to apply and journaldefault CheckpointName getCheckpointName()
getCheckpointName
in interface Checkpointed
default CompletableFuture<Void> writeToCheckpoint(File directory, ExecutorService executorService)
Checkpointed
writeToCheckpoint
in interface Checkpointed
directory
- where the checkpoint will be writtenexecutorService
- to use when running tasks asynchronouslydefault void writeToCheckpoint(OutputStream output) throws IOException, InterruptedException
Checkpointed
InterruptedException
if they get
interrupted while running.writeToCheckpoint
in interface Checkpointed
writeToCheckpoint
in interface Journaled
output
- the output stream to write toIOException
InterruptedException
default CompletableFuture<Void> restoreFromCheckpoint(File directory, ExecutorService executorService)
Checkpointed
restoreFromCheckpoint
in interface Checkpointed
directory
- where the checkpoint will be locatedexecutorService
- to use when running asynchronous tasksdefault void restoreFromCheckpoint(CheckpointInputStream input) throws IOException
Checkpointed
restoreFromCheckpoint
in interface Checkpointed
restoreFromCheckpoint
in interface Journaled
input
- an input stream with checkpoint dataIOException
default CloseableIterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
CloseableIterator
that iterates all the journal entriesJournaled getDelegate()
Copyright © 2023. All Rights Reserved.