Class DisabledRaftStorage
java.lang.Object
org.opendaylight.controller.cluster.raft.spi.RaftStorage
org.opendaylight.controller.cluster.raft.spi.DisabledRaftStorage
- All Implemented Interfaces:
EntryStore
,ImmediateEntryStore
,SnapshotStore
@NonNullByDefault
public final class DisabledRaftStorage
extends RaftStorage
implements ImmediateEntryStore
A
RaftStorage
backing non-persistent mode of RaftActor
operation. It works with any actor which can
provide a RaftStorageCompleter
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.controller.cluster.raft.spi.RaftStorage
RaftStorage.CancellableTask<T>
-
Field Summary
Fields inherited from class org.opendaylight.controller.cluster.raft.spi.RaftStorage
completer, compression, directory
-
Constructor Summary
ConstructorsConstructorDescriptionDisabledRaftStorage
(RaftStorageCompleter completer, Path directory, CompressionType compression, FileBackedOutputStream.Configuration streamConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
preStop()
void
saveSnapshot
(RaftSnapshot raftSnapshot, EntryInfo lastIncluded, @Nullable StateSnapshot.ToStorage<?> snapshot, Instant timestamp) Saves a snapshot synchronously and delete any previous snapshots.void
saveVotingConfig
(@Nullable VotingConfig votingConfig, Instant timestamp) void
startPersistEntry
(ReplicatedLogEntry entry, RaftCallback<Long> callback) Persists an entry to the applicable journal asynchronously.Methods inherited from class org.opendaylight.controller.cluster.raft.spi.RaftStorage
addToStringAtrributes, completer, lastSnapshot, memberId, saveSnapshot, start, stop, streamToInstall, submitTask, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.controller.cluster.raft.spi.EntryStore
completer, persistEntry
Methods inherited from interface org.opendaylight.controller.cluster.raft.spi.ImmediateEntryStore
checkpointLastApplied, discardHead, discardTail
-
Constructor Details
-
DisabledRaftStorage
public DisabledRaftStorage(RaftStorageCompleter completer, Path directory, CompressionType compression, FileBackedOutputStream.Configuration streamConfig)
-
-
Method Details
-
postStart
protected void postStart()- Specified by:
postStart
in classRaftStorage
-
preStop
protected void preStop()- Specified by:
preStop
in classRaftStorage
-
startPersistEntry
Description copied from interface:EntryStore
Persists an entry to the applicable journal asynchronously.- Specified by:
startPersistEntry
in interfaceEntryStore
- Specified by:
startPersistEntry
in interfaceImmediateEntryStore
- Parameters:
entry
- the journal entry to persistcallback
- the callback when persistence is complete
-
saveSnapshot
public void saveSnapshot(RaftSnapshot raftSnapshot, EntryInfo lastIncluded, @Nullable StateSnapshot.ToStorage<?> snapshot, Instant timestamp) throws IOException Description copied from interface:SnapshotStore
Saves a snapshot synchronously and delete any previous snapshots. This method should only be called during recovery.- Specified by:
saveSnapshot
in interfaceSnapshotStore
- Overrides:
saveSnapshot
in classRaftStorage
- Parameters:
raftSnapshot
- theRaftSnapshot
lastIncluded
- last included index/termsnapshot
- the snapshot, ornull
if not applicabletimestamp
- snapshot timestamp- Throws:
IOException
- when an I/O error occurs
-
saveVotingConfig
public void saveVotingConfig(@Nullable VotingConfig votingConfig, Instant timestamp) throws IOException - Throws:
IOException
-