Class EventSourcedRememberEntitiesShardStore
- java.lang.Object
-
- akka.cluster.sharding.internal.EventSourcedRememberEntitiesShardStore
-
- All Implemented Interfaces:
Actor
,ActorLogging
,Stash
,StashFactory
,StashSupport
,UnrestrictedStash
,RequiresMessageQueue<DequeBasedMessageQueueSemantics>
,Eventsourced
,PersistenceIdentity
,PersistenceRecovery
,PersistenceStash
,PersistentActor
,Snapshotter
public final class EventSourcedRememberEntitiesShardStore extends java.lang.Object implements PersistentActor, ActorLogging
INTERNAL APIPersistent actor keeping the state for Akka Persistence backed remember entities (enabled through
state-store-mode=persistence
).- See Also:
ClusterSharding extension
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventSourcedRememberEntitiesShardStore.EntitiesStarted
State
change for starting a set of entities in thisShard
static class
EventSourcedRememberEntitiesShardStore.EntitiesStarted$
static class
EventSourcedRememberEntitiesShardStore.EntitiesStopped
State
change for an entity which has terminated.static class
EventSourcedRememberEntitiesShardStore.EntitiesStopped$
static class
EventSourcedRememberEntitiesShardStore.StartedAck$
static class
EventSourcedRememberEntitiesShardStore.State
Persistent state of the Shard.static class
EventSourcedRememberEntitiesShardStore.State$
static interface
EventSourcedRememberEntitiesShardStore.StateChange
A case class which represents a state change for the Shard-
Nested 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$
-
-
Constructor Summary
Constructors Constructor Description EventSourcedRememberEntitiesShardStore(java.lang.String typeName, java.lang.String shardId, ClusterShardingSettings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
Scala API: Stores the context for this actor, including self, and sender.protected void
akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
The 'self' field holds the ActorRef for this actor.protected void
akka$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
ActorContext
context()
Scala API: Stores the context for this actor, including self, and sender.protected ActorRef
journal()
java.lang.String
journalPluginId()
Configuration id of the journal plugin servicing this persistent actor.DequeBasedMessageQueueSemantics
mailbox()
java.lang.String
persistenceId()
Id of the persistent entity for which messages should be replayed.void
postStop()
User overridable callback.static Props
props(java.lang.String typeName, java.lang.String shardId, ClusterShardingSettings settings)
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveCommand()
Command handler.scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveRecover()
Recovery handler that receives persisted events during recovery.void
saveSnapshotWhenNeeded()
ActorRef
self()
The 'self' field holds the ActorRef for this actor.java.lang.String
snapshotPluginId()
Configuration id of the snapshot plugin servicing this persistent actor.protected ActorRef
snapshotStore()
Snapshot store plugin actor.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.actor.Actor
postRestart, preStart, sender, supervisorStrategy
-
Methods inherited from interface akka.actor.ActorLogging
_log_$eq, log
-
Methods inherited from interface akka.persistence.Eventsourced
_lastSequenceNr_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, batchAtomicWrite, changeState, currentState_$eq, deleteMessages, eventBatch_$eq, flushBatch, flushJournalBatch, internalDefer, internalDeferAsync, internalDeleteMessagesBeforeSnapshot, internalPersist, internalPersistAll, internalPersistAllAsync, internalPersistAsync, journalBatch_$eq, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, onReplaySuccess, peekApplyHandler, pendingStashingPersistInvocations_$eq, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, sendBatchedEventsToJournal, sequenceNr_$eq, setLastSequenceNr, snapshotSequenceNr, snapshotterId, startRecovery, stash, stashInternally, super$aroundPostRestart, super$aroundPostStop, super$aroundPreRestart, super$aroundPreStart, super$aroundReceive, super$stash, super$unhandled, unhandled, unstashAll, unstashInternally, updateLastSequenceNr, waitingRecoveryPermit, writeEventFailed, writeEventRejected, writeEventSucceeded, writeInProgress_$eq
-
Methods inherited from interface akka.persistence.PersistenceRecovery
recovery
-
Methods inherited from interface akka.persistence.PersistenceStash
internalStashOverflowStrategy
-
Methods inherited from interface akka.persistence.PersistentActor
defer, deferAsync, persist, persistAll, persistAllAsync, persistAsync, receive
-
Methods inherited from interface akka.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
-
Methods inherited from interface akka.actor.StashFactory
createStash
-
Methods inherited from interface akka.actor.StashSupport
actorCell, clearStash, enqueueFirst, prepend, theStash_$eq, unstash, unstashAll
-
Methods inherited from interface akka.actor.UnrestrictedStash
preRestart, super$postStop, super$preRestart
-
-
-
-
Constructor Detail
-
EventSourcedRememberEntitiesShardStore
public EventSourcedRememberEntitiesShardStore(java.lang.String typeName, java.lang.String shardId, ClusterShardingSettings settings)
-
-
Method Detail
-
props
public static Props props(java.lang.String typeName, java.lang.String shardId, ClusterShardingSettings settings)
-
journal
protected ActorRef journal()
- Specified by:
journal
in interfaceEventsourced
-
snapshotStore
protected ActorRef snapshotStore()
Description copied from interface:Snapshotter
Snapshot store plugin actor.- Specified by:
snapshotStore
in interfaceEventsourced
- Specified by:
snapshotStore
in interfaceSnapshotter
-
mailbox
public DequeBasedMessageQueueSemantics mailbox()
- Specified by:
mailbox
in interfaceStashSupport
-
akka$actor$StashSupport$_setter_$mailbox_$eq
protected void akka$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
- Specified by:
akka$actor$StashSupport$_setter_$mailbox_$eq
in interfaceStashSupport
-
context
public ActorContext context()
Description copied from interface:Actor
Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward
.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API.getContext
returns aAbstractActor.ActorContext
, which is the Java API of the actor context.- Specified by:
context
in interfaceActor
- Specified by:
context
in interfaceStashSupport
-
self
public final ActorRef self()
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
self
in interfaceActor
- Specified by:
self
in interfaceStashSupport
-
akka$actor$Actor$_setter_$context_$eq
protected void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
Description copied from interface:Actor
Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward
.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API.getContext
returns aAbstractActor.ActorContext
, which is the Java API of the actor context.- Specified by:
akka$actor$Actor$_setter_$context_$eq
in interfaceActor
-
akka$actor$Actor$_setter_$self_$eq
protected final void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
Description copied from interface:Actor
The 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
akka$actor$Actor$_setter_$self_$eq
in interfaceActor
-
persistenceId
public java.lang.String persistenceId()
Description copied from interface:PersistenceIdentity
Id of the persistent entity for which messages should be replayed.- Specified by:
persistenceId
in interfacePersistenceIdentity
-
journalPluginId
public java.lang.String journalPluginId()
Description copied from interface:PersistenceIdentity
Configuration id of the journal plugin servicing this persistent actor. When empty, looks inakka.persistence.journal.plugin
to find configuration entry path. When configured, usesjournalPluginId
as absolute path to the journal configuration entry. Configuration entry must contain few required fields, such asclass
. Seesrc/main/resources/reference.conf
.- Specified by:
journalPluginId
in interfacePersistenceIdentity
-
snapshotPluginId
public java.lang.String snapshotPluginId()
Description copied from interface:PersistenceIdentity
Configuration id of the snapshot plugin servicing this persistent actor. When empty, looks inakka.persistence.snapshot-store.plugin
to find configuration entry path. When configured, usessnapshotPluginId
as absolute path to the snapshot store configuration entry. Configuration entry must contain few required fields, such asclass
. Seesrc/main/resources/reference.conf
.- Specified by:
snapshotPluginId
in interfacePersistenceIdentity
-
receiveRecover
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
Description copied from interface:Eventsourced
Recovery handler that receives persisted events during recovery. If a state snapshot has been captured and saved, this handler will receive aSnapshotOffer
message followed by events that are younger than the offered snapshot.This handler must not have side-effects other than changing persistent actor state i.e. it should not perform actions that may fail, such as interacting with external services, for example.
If there is a problem with recovering the state of the actor from the journal, the error will be logged and the actor will be stopped.
- Specified by:
receiveRecover
in interfaceEventsourced
- See Also:
Recovery
-
receiveCommand
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()
Description copied from interface:Eventsourced
Command handler. Typically validates commands against current state (and/or by communication with other actors). On successful validation, one or more events are derived from a command and these events are then persisted by callingpersist
.- Specified by:
receiveCommand
in interfaceEventsourced
-
postStop
public void postStop()
Description copied from interface:Actor
User overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.- Specified by:
postStop
in interfaceActor
- Specified by:
postStop
in interfaceUnrestrictedStash
-
saveSnapshotWhenNeeded
public void saveSnapshotWhenNeeded()
-
-