public class PersistentShard extends Shard implements PersistentActor, ActorLogging
This actor creates children entity actors on demand that it is told to be
responsible for. It is used when rememberEntities is enabled.
ClusterSharding extensionShard.CurrentShardState, Shard.CurrentShardState$, Shard.EntityStarted, Shard.EntityStarted$, Shard.EntityStopped, Shard.EntityStopped$, Shard.GetCurrentShardState$, Shard.GetShardStats$, Shard.RestartEntities, Shard.RestartEntities$, Shard.RestartEntity, Shard.RestartEntity$, Shard.ShardCommand, Shard.ShardQuery, Shard.ShardStats, Shard.ShardStats$, Shard.State, Shard.State$, Shard.StateChangeEventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.StateActor.emptyBehavior$, Actor.ignoringBehavior$| Constructor and Description |
|---|
PersistentShard(java.lang.String typeName,
java.lang.String shardId,
Props entityProps,
ClusterShardingSettings settings,
scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> extractEntityId,
scala.Function1<java.lang.Object,java.lang.String> extractShardId,
java.lang.Object handOffStopMessage) |
| Modifier and Type | Method and Description |
|---|---|
void |
deliverTo(java.lang.String id,
java.lang.Object msg,
java.lang.Object payload,
ActorRef snd) |
void |
entityTerminated(ActorRef ref) |
void |
initialized() |
protected ActorRef |
journal() |
java.lang.String |
journalPluginId()
Configuration id of the journal plugin servicing this persistent actor or view.
|
DequeBasedMessageQueueSemantics |
mailbox() |
java.lang.String |
persistenceId()
Id of the persistent entity for which messages should be replayed.
|
<A> void |
processChange(A event,
scala.Function1<A,scala.runtime.BoxedUnit> handler) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function
with the actor logic.
|
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.
|
EntityRecoveryStrategy |
rememberedEntitiesRecoveryStrategy() |
void |
saveSnapshotWhenNeeded() |
java.lang.String |
snapshotPluginId()
Configuration id of the snapshot plugin servicing this persistent actor or view.
|
protected ActorRef |
snapshotStore()
Snapshot store plugin actor.
|
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, akka$actor$ActorLogging$$_log_$eq, akka$actor$ActorLogging$$_log, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, deliverMessage, getEntity, handOff, handOffStopper, idByRef, log, messageBuffers, passivate, passivateCompleted, passivating, postRestart, postStop, preRestart, preStart, props, receiveCoordinatorMessage, receiveShardCommand, receiveShardQuery, receiveShardRegionCommand, receiveTerminated, refById, self, sender, sendMsgBuffer, state, supervisorStrategy, unhandledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, changeState, deferAsync, deleteMessages, flushBatch, flushJournalBatch, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, onReplaySuccess, peekApplyHandler, persist, persist, persistAll, persistAllAsync, persistAsync, persistAsync, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, setLastSequenceNr, snapshotSequenceNr, snapshotterId, startRecovery, stashInternally, unhandled, unstashAll, unstashInternally, updateLastSequenceNr, waitingRecoveryPermitdeleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshotinternalStashOverflowStrategycontext, postRestart, preStart, self, sender, supervisorStrategyactorCell, clearStash, context, enqueueFirst, prepend, self, stash, unstash, unstashAllcreateStashrecoverylogpublic PersistentShard(java.lang.String typeName,
java.lang.String shardId,
Props entityProps,
ClusterShardingSettings settings,
scala.PartialFunction<java.lang.Object,scala.Tuple2<java.lang.String,java.lang.Object>> extractEntityId,
scala.Function1<java.lang.Object,java.lang.String> extractShardId,
java.lang.Object handOffStopMessage)
protected ActorRef journal()
journal in interface Eventsourcedprotected ActorRef snapshotStore()
SnapshottersnapshotStore in interface EventsourcedsnapshotStore in interface Snapshotterpublic DequeBasedMessageQueueSemantics mailbox()
mailbox in interface StashSupportpublic EntityRecoveryStrategy rememberedEntitiesRecoveryStrategy()
public java.lang.String persistenceId()
PersistenceIdentitypersistenceId in interface PersistenceIdentitypublic java.lang.String journalPluginId()
PersistenceIdentityakka.persistence.journal.plugin to find configuration entry path.
When configured, uses journalPluginId as absolute path to the journal configuration entry.
Configuration entry must contain few required fields, such as class. See src/main/resources/reference.conf.journalPluginId in interface PersistenceIdentitypublic java.lang.String snapshotPluginId()
PersistenceIdentityakka.persistence.snapshot-store.plugin to find configuration entry path.
When configured, uses snapshotPluginId as absolute path to the snapshot store configuration entry.
Configuration entry must contain few required fields, such as class. See src/main/resources/reference.conf.snapshotPluginId in interface PersistenceIdentitypublic void initialized()
initialized in class Shardpublic scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actorpublic <A> void processChange(A event,
scala.Function1<A,scala.runtime.BoxedUnit> handler)
processChange in class Shardpublic void saveSnapshotWhenNeeded()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
EventsourcedSnapshotOffer 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.
receiveRecover in interface EventsourcedRecoverypublic scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()
Eventsourcedpersist.receiveCommand in interface EventsourcedreceiveCommand in class Shardpublic void entityTerminated(ActorRef ref)
entityTerminated in class Shard