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 extension
Shard.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.StateChange
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.State
Actor.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, unhandled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostRestart, 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, waitingRecoveryPermit
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
internalStashOverflowStrategy
context, postRestart, preStart, self, sender, supervisorStrategy
actorCell, clearStash, context, enqueueFirst, prepend, self, stash, unstash, unstashAll
createStash
recovery
log
public 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 Eventsourced
protected ActorRef snapshotStore()
Snapshotter
snapshotStore
in interface Eventsourced
snapshotStore
in interface Snapshotter
public DequeBasedMessageQueueSemantics mailbox()
mailbox
in interface StashSupport
public EntityRecoveryStrategy rememberedEntitiesRecoveryStrategy()
public java.lang.String persistenceId()
PersistenceIdentity
persistenceId
in interface PersistenceIdentity
public java.lang.String journalPluginId()
PersistenceIdentity
akka.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 PersistenceIdentity
public java.lang.String snapshotPluginId()
PersistenceIdentity
akka.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 PersistenceIdentity
public void initialized()
initialized
in class Shard
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
public <A> void processChange(A event, scala.Function1<A,scala.runtime.BoxedUnit> handler)
processChange
in class Shard
public void saveSnapshotWhenNeeded()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveRecover()
Eventsourced
SnapshotOffer
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 Eventsourced
Recovery
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveCommand()
Eventsourced
persist
.receiveCommand
in interface Eventsourced
receiveCommand
in class Shard
public void entityTerminated(ActorRef ref)
entityTerminated
in class Shard