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 voidprotected voidpreStop()voidsaveSnapshot(RaftSnapshot raftSnapshot, EntryInfo lastIncluded, @Nullable StateSnapshot.ToStorage<?> snapshot, Instant timestamp) Saves a snapshot synchronously and delete any previous snapshots.voidsaveVotingConfig(@Nullable VotingConfig votingConfig, Instant timestamp) voidstartPersistEntry(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, saveSnapshot, start, stop, streamToInstall, submitTask, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opendaylight.controller.cluster.raft.spi.EntryStore
completer, persistEntryMethods 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:
postStartin classRaftStorage
-
preStop
protected void preStop()- Specified by:
preStopin classRaftStorage
-
startPersistEntry
Description copied from interface:EntryStorePersists an entry to the applicable journal asynchronously.- Specified by:
startPersistEntryin interfaceEntryStore- Specified by:
startPersistEntryin 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:SnapshotStoreSaves a snapshot synchronously and delete any previous snapshots. This method should only be called during recovery.- Specified by:
saveSnapshotin interfaceSnapshotStore- Overrides:
saveSnapshotin classRaftStorage- Parameters:
raftSnapshot- theRaftSnapshotlastIncluded- last included index/termsnapshot- the snapshot, ornullif 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
-