@NotThreadSafe public class RaftJournal extends Object implements Journal
Constructor and Description |
---|
RaftJournal(Journaled stateMachine,
URI location,
AtomicReference<AsyncJournalWriter> journalWriter,
Lock stateReadLock) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
JournalContext |
createJournalContext() |
URI |
getLocation() |
Journaled |
getStateMachine() |
public RaftJournal(Journaled stateMachine, URI location, AtomicReference<AsyncJournalWriter> journalWriter, Lock stateReadLock)
stateMachine
- the state machine for this journallocation
- the location of the raft journaljournalWriter
- reference to the journal writer to use for writing to the journalstateReadLock
- lock to acquire before exposing the journal for modificationpublic Journaled getStateMachine()
public URI getLocation()
getLocation
in interface Journal
public JournalContext createJournalContext() throws UnavailableException
createJournalContext
in interface Journal
UnavailableException
- if a context cannot be created because the journal has been
closed.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.