Class Shard
java.lang.Object
akka.actor.AbstractActor
akka.persistence.AbstractPersistentActor
org.opendaylight.controller.cluster.common.actor.AbstractUntypedPersistentActor
org.opendaylight.controller.cluster.raft.RaftActor
org.opendaylight.controller.cluster.datastore.Shard
- All Implemented Interfaces:
Actor,Stash,StashFactory,StashSupport,UnrestrictedStash,RequiresMessageQueue<DequeBasedMessageQueueSemantics>,AbstractPersistentActorLike,Eventsourced,PersistenceIdentity,PersistenceRecovery,PersistenceStash,Snapshotter,ExecuteInSelfActor
A Shard represents a portion of the logical data tree.
Our Shard uses InMemoryDataTree as it's internal representation and delegates all requests it
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classShard.AbstractBuilder<T extends Shard.AbstractBuilder<T,S>, S extends Shard> static classNested classes/interfaces inherited from class akka.actor.AbstractActor
AbstractActor.ActorContext, AbstractActor.ReceiveNested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$Nested classes/interfaces inherited from interface akka.persistence.Eventsourced
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$ -
Field Summary
FieldsFields inherited from class org.opendaylight.controller.cluster.common.actor.AbstractUntypedPersistentActor
LOG -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidapplyState(ActorRef clientActor, Identifier identifier, Object data) The applyState method will be called by the RaftActor when some data needs to be applied to the actor's state.static Shard.Builderbuilder()protected final RaftActorRecoveryCohortReturns the RaftActorRecoveryCohort to participate in persistence recovery.protected final RaftActorSnapshotCohortReturns the RaftActorSnapshotCohort to participate in snapshot captures.Notifier Actor for this RaftActor to notify when a role change happens.protected voidhandleNonRaftCommand(Object message) Method exposed for subclasses to plug-in their logic.protected final voidhandleRecover(Object message) protected booleanfinal Stringprotected final LeaderStateChangednewLeaderStateChanged(String memberId, String leaderId, short leaderPayloadVersion) protected final OnDemandRaftState.AbstractBuilder<?, ?> protected final voidonLeaderChanged(String oldLeader, String newLeader) protected voidThis method is called when recovery is complete.protected final voidThis method will be called by the RaftActor when the state of the RaftActor changes.protected final voidpauseLeader(Runnable operation) This method is called prior to operations such as leadership transfer and actor shutdown when the leader must pause or stop its duties.final Stringfinal voidpostStop()protected final voidThis method is invoked when the actions hooked to the leader becoming paused failed to execute and the leader should resume normal operations.Methods inherited from class org.opendaylight.controller.cluster.raft.RaftActor
changeCurrentBehavior, getCurrentBehavior, getCurrentTerm, getId, getLeader, getLeaderId, getRaftActorContext, getRaftState, handleCommand, hasFollowers, isLeader, isLeaderActive, isLeadershipTransferInProgress, newRaftActorRecoverySupport, onVotingStateChangeComplete, persistData, persistence, preStart, setPeerAddress, setPersistence, setPersistence, snapshotSequenceNr, updateConfigParamsMethods inherited from class org.opendaylight.controller.cluster.common.actor.AbstractUntypedPersistentActor
createReceive, createReceiveRecover, executeInSelf, ignoreMessage, unknownMessageMethods inherited from class akka.persistence.AbstractPersistentActor
akka$actor$StashSupport$_setter_$akka$actor$StashSupport$$capacity_$eq, akka$actor$StashSupport$_setter_$mailbox_$eq, akka$actor$StashSupport$$capacity, akka$actor$StashSupport$$theStash, akka$actor$StashSupport$$theStash_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$extension_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$instanceId_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$internalStash_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$maxMessageBatchSize_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$pendingInvocations_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$persistingEvents_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$processingCommands_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$unstashFilterPredicate_$eq, akka$persistence$Eventsourced$_setter_$akka$persistence$Eventsourced$$writerUuid_$eq, akka$persistence$Eventsourced$$_lastSequenceNr, akka$persistence$Eventsourced$$_lastSequenceNr_$eq, akka$persistence$Eventsourced$$currentState, akka$persistence$Eventsourced$$currentState_$eq, akka$persistence$Eventsourced$$eventBatch, akka$persistence$Eventsourced$$eventBatch_$eq, akka$persistence$Eventsourced$$extension, akka$persistence$Eventsourced$$instanceId, akka$persistence$Eventsourced$$internalStash, akka$persistence$Eventsourced$$journalBatch, akka$persistence$Eventsourced$$journalBatch_$eq, akka$persistence$Eventsourced$$maxMessageBatchSize, akka$persistence$Eventsourced$$pendingInvocations, akka$persistence$Eventsourced$$pendingStashingPersistInvocations, akka$persistence$Eventsourced$$pendingStashingPersistInvocations_$eq, akka$persistence$Eventsourced$$persistingEvents, akka$persistence$Eventsourced$$processingCommands, akka$persistence$Eventsourced$$sequenceNr, akka$persistence$Eventsourced$$sequenceNr_$eq, akka$persistence$Eventsourced$$unstashFilterPredicate, akka$persistence$Eventsourced$$writeInProgress, akka$persistence$Eventsourced$$writeInProgress_$eq, akka$persistence$Eventsourced$$writerUuid, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, clearStash, createStash, defer, deferAsync, deleteMessages, deleteSnapshot, deleteSnapshots, internalDefer, internalDeferAsync, internalDeleteMessagesBeforeSnapshot, internalPersist, internalPersistAll, internalPersistAllAsync, internalPersistAsync, internalStashOverflowStrategy, journal, lastSequenceNr, loadSnapshot, mailbox, onPersistFailure, onPersistRejected, onRecoveryFailure, onReplaySuccess, persist, persistAll, persistAllAsync, persistAsync, prepend, preRestart, receiveCommand, receiveRecover, recovery, recoveryFinished, recoveryRunning, saveSnapshot, snapshotPluginId, snapshotStore, snapshotterId, stash, unhandled, unstash, unstashAll, unstashAllMethods inherited from class akka.actor.AbstractActor
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, context, emptyBehavior, getContext, getSelf, getSender, postRestart, preRestart, receive, receiveBuilder, self, sender, supervisorStrategyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface akka.actor.Actor
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, context, postRestart, receive, self, sender, supervisorStrategyMethods inherited from interface akka.persistence.Eventsourced
akka$persistence$Eventsourced$$changeState, akka$persistence$Eventsourced$$flushBatch, akka$persistence$Eventsourced$$flushJournalBatch, akka$persistence$Eventsourced$$log, akka$persistence$Eventsourced$$peekApplyHandler, akka$persistence$Eventsourced$$recovering, akka$persistence$Eventsourced$$setLastSequenceNr, akka$persistence$Eventsourced$$startRecovery, akka$persistence$Eventsourced$$stashInternally, akka$persistence$Eventsourced$$unstashInternally, akka$persistence$Eventsourced$$updateLastSequenceNr, akka$persistence$Eventsourced$$writeEventFailed, akka$persistence$Eventsourced$$writeEventRejected, akka$persistence$Eventsourced$$writeEventSucceededMethods inherited from interface akka.actor.StashSupport
context, self
-
Field Details
-
DEFAULT_NAME
- See Also:
-
NON_PERSISTENT_JOURNAL_ID
- See Also:
-
-
Method Details
-
postStop
-
handleRecover
- Overrides:
handleRecoverin classRaftActor
-
handleNonRaftCommand
Description copied from class:RaftActorMethod exposed for subclasses to plug-in their logic. This method is invoked byRaftActor.handleCommand(Object)for messages which are not handled by this class. Subclasses overriding this class should fall back to this implementation for messages which they do not handle- Overrides:
handleNonRaftCommandin classRaftActor- Parameters:
message- Incoming command message
-
getRoleChangeNotifier
Description copied from class:RaftActorNotifier Actor for this RaftActor to notify when a role change happens.- Specified by:
getRoleChangeNotifierin classRaftActor- Returns:
- ActorRef - ActorRef of the notifier or Optional.absent if none.
-
newLeaderStateChanged
protected final LeaderStateChanged newLeaderStateChanged(String memberId, String leaderId, short leaderPayloadVersion) - Overrides:
newLeaderStateChangedin classRaftActor
-
isIsolatedLeader
protected boolean isIsolatedLeader() -
getRaftActorSnapshotCohort
Description copied from class:RaftActorReturns the RaftActorSnapshotCohort to participate in snapshot captures.- Specified by:
getRaftActorSnapshotCohortin classRaftActor
-
getRaftActorRecoveryCohort
Description copied from class:RaftActorReturns the RaftActorRecoveryCohort to participate in persistence recovery.- Specified by:
getRaftActorRecoveryCohortin classRaftActor
-
onRecoveryComplete
protected void onRecoveryComplete()Description copied from class:RaftActorThis method is called when recovery is complete.- Specified by:
onRecoveryCompletein classRaftActor
-
applyState
Description copied from class:RaftActorThe applyState method will be called by the RaftActor when some data needs to be applied to the actor's state.- Specified by:
applyStatein classRaftActor- Parameters:
clientActor- A reference to the client who sent this message. This is the same reference that was passed to persistData by the derived actor. clientActor may be null when the RaftActor is behaving as a follower or during recovery.identifier- The identifier of the persisted data. This is also the same identifier that was passed to persistData by the derived actor. identifier may be null when the RaftActor is behaving as a follower or during recoverydata- A piece of data that was persisted by the persistData call. This should NEVER be null.
-
onStateChanged
protected final void onStateChanged()Description copied from class:RaftActorThis method will be called by the RaftActor when the state of the RaftActor changes. The derived actor can then use methods like isLeader or getLeader to do something useful- Specified by:
onStateChangedin classRaftActor
-
onLeaderChanged
- Overrides:
onLeaderChangedin classRaftActor
-
pauseLeader
Description copied from class:RaftActorThis method is called prior to operations such as leadership transfer and actor shutdown when the leader must pause or stop its duties. This method allows derived classes to gracefully pause or finish current work prior to performing the operation. On completion of any work, the run method must be called on the given Runnable to proceed with the given operation. Important: the run method must be called on this actor's thread dispatcher as as it modifies internal state.The default implementation immediately runs the operation.
- Overrides:
pauseLeaderin classRaftActor- Parameters:
operation- the operation to run
-
unpauseLeader
protected final void unpauseLeader()Description copied from class:RaftActorThis method is invoked when the actions hooked to the leader becoming paused failed to execute and the leader should resume normal operations.Note this method can be invoked even before the operation supplied to
RaftActor.pauseLeader(Runnable)is invoked.- Overrides:
unpauseLeaderin classRaftActor
-
newOnDemandRaftStateBuilder
- Overrides:
newOnDemandRaftStateBuilderin classRaftActor
-
persistenceId
-
journalPluginId
- Specified by:
journalPluginIdin interfacePersistenceIdentity- Overrides:
journalPluginIdin classAbstractPersistentActor
-
builder
-