package typed
- Alphabetic
- Public
- Protected
Package Members
Type Members
- final class ChangeNumberOfProcesses extends ShardedDaemonProcessCommand with ClusterShardingTypedSerializable
Tell the sharded daemon process to rescale to the given number of processes.
- sealed trait ClusterShardingQuery extends AnyRef
Protocol for querying sharding state e.g.
Protocol for querying sharding state e.g. A ShardRegion's state
- final class ClusterShardingSettings extends AnyRef
- Annotations
- @nowarn()
- final case class GetClusterShardingStats(entityTypeKey: EntityTypeKey[_], timeout: FiniteDuration, replyTo: ActorRef[ClusterShardingStats]) extends ClusterShardingQuery with Product with Serializable
Query the statistics about the currently running sharded entities in the entire cluster.
Query the statistics about the currently running sharded entities in the entire cluster. If the given
timeout
is reached without answers from all shard regions the reply will contain an empty map of regions.Intended for testing purpose to see when cluster sharding is "ready" or to monitor the state of the shard regions.
- timeout
the timeout applied to querying all alive regions
- replyTo
the actor to send the result to
- final class GetNumberOfProcesses extends ShardedDaemonProcessCommand with ClusterShardingTypedSerializable
Query the sharded daemon process for the current scale
- final case class GetShardRegionState(entityTypeKey: EntityTypeKey[_], replyTo: ActorRef[CurrentShardRegionState]) extends ClusterShardingQuery with Product with Serializable
Query the ShardRegion state for the given entity type key.
Query the ShardRegion state for the given entity type key. This will get the state of the local ShardRegion's state.
Intended for testing purpose to see when cluster sharding is "ready" or to monitor the state of the shard regions.
For the statistics for the entire cluster, see GetClusterShardingStats.
- final class HashCodeMessageExtractor[M] extends ShardingMessageExtractor[ShardingEnvelope[M], M]
Default message extractor type, using envelopes to identify what entity a message is for and the hashcode of the entityId to decide which shard an entity belongs to.
Default message extractor type, using envelopes to identify what entity a message is for and the hashcode of the entityId to decide which shard an entity belongs to.
This is recommended since it does not force details about sharding into the entity protocol
- M
The type of message accepted by the entity actor
- abstract class HashCodeNoEnvelopeMessageExtractor[M] extends ShardingMessageExtractor[M, M]
Default message extractor type, using a property of the message to identify what entity a message is for and the hashcode of the entityId to decide which shard an entity belongs to.
Default message extractor type, using a property of the message to identify what entity a message is for and the hashcode of the entityId to decide which shard an entity belongs to.
This is recommended since it does not force details about sharding into the entity protocol
- M
The type of message accepted by the entity actor
- final class Murmur2MessageExtractor[M] extends ShardingMessageExtractor[ShardingEnvelope[M], M]
The murmur2 message extractor uses the same algorithm as the default kafka partitioner allowing kafka partitions to be mapped to shards.
The murmur2 message extractor uses the same algorithm as the default kafka partitioner allowing kafka partitions to be mapped to shards. This can be used with the akka.cluster.sharding.external.ExternalShardAllocationStrategy to have messages processed locally.
Extend Murmur2NoEnvelopeMessageExtractor to not use a message envelope extractor.
- abstract class Murmur2NoEnvelopeMessageExtractor[M] extends ShardingMessageExtractor[M, M]
- trait NumberOfProcesses extends AnyRef
Reply for GetNumberOfProcesses
Reply for GetNumberOfProcesses
Not for user extension
- Annotations
- @DoNotInherit()
- final class ReplicatedEntity[M] extends AnyRef
Settings for a specific replica id in replicated sharding Currently only Entity's with ShardingEnvelope are supported but this may change in the future
- final class ReplicatedEntityProvider[M] extends AnyRef
- M
The type of messages the replicated entity accepts
- trait ReplicatedSharding[M] extends AnyRef
Represents the sharding instances for the replicas of one Replicated Event Sourcing entity type
Represents the sharding instances for the replicas of one Replicated Event Sourcing entity type
Not for user extension.
- Annotations
- @DoNotInherit()
- trait ReplicatedShardingExtension extends Extension
Not for user extension.
Not for user extension.
- Annotations
- @DoNotInherit()
- trait ShardedDaemonProcessCommand extends AnyRef
Commands for interacting with the sharded daemon process
Commands for interacting with the sharded daemon process
Not for user extension
- Annotations
- @DoNotInherit()
- trait ShardedDaemonProcessContext extends AnyRef
Context with details about the Sharded Daemon Process instance to use when starting it
Context with details about the Sharded Daemon Process instance to use when starting it
Not for user extension
- Annotations
- @DoNotInherit() @ApiMayChange()
- final class ShardedDaemonProcessSettings extends AnyRef
Not for user constructions, use factory methods to instantiate.
- final case class ShardingEnvelope[M](entityId: String, message: M) extends WrappedMessage with ClusterShardingTypedSerializable with Product with Serializable
Default envelope type that may be used with Cluster Sharding.
Default envelope type that may be used with Cluster Sharding.
Cluster Sharding provides a default HashCodeMessageExtractor that is able to handle these types of messages, by hashing the entityId into into the shardId. It is not the only, but a convenient way to send envelope-wrapped messages via cluster sharding.
The alternative way of routing messages through sharding is to not use envelopes, and have the message types themselves carry identifiers.
- entityId
The business domain identifier of the entity.
- message
The message to be send to the entity.
- Exceptions thrown
`InvalidMessageException`
if message is null.
- abstract class ShardingMessageExtractor[E, M] extends AnyRef
Entirely customizable typed message extractor.
Entirely customizable typed message extractor. Prefer HashCodeMessageExtractor or HashCodeNoEnvelopeMessageExtractorif possible.
- E
Possibly an Envelope around the messages accepted by the entity actor, is the same as
M
if there is no envelope.- M
The type of message accepted by the entity actor
- class SliceRangeShardAllocationStrategy extends ActorSystemDependentAllocationStrategy with ClusterShardAllocationMixin
Intended to be used with database sharding, https://doc.akka.io/libraries/akka-persistence-r2dbc/current/data-partition.html, with a cluster of many Akka nodes.
Intended to be used with database sharding, https://doc.akka.io/libraries/akka-persistence-r2dbc/current/data-partition.html, with a cluster of many Akka nodes. To avoid that each Akka node has database connections to all databases it is preferred to collocate entities with the same slice and contiguous range of slices to the same Akka node. Thereby the connections from one Akka node will go to one or a few databases since the database sharding is based on slice ranges.
It must be used together with the SliceRangeShardAllocationStrategy.ShardBySliceMessageExtractor.
Create a new instance of this for each entity type, i.e. a
SliceRangeShardAllocationStrategy
instance must not be shared between different entity types.It will not rebalance when there is already an ongoing rebalance in progress.
Important: Do not change shard allocation strategy in a rolling update. The cluster must be fully stopped and then started again when changing to a different allocation strategy.
Not intended for public inheritance/implementation.
- Annotations
- @DoNotInherit()
Value Members
- object ChangeNumberOfProcesses
- object ClusterShardingSettings
- object GetNumberOfProcesses
- object ReplicatedEntity
- object ReplicatedEntityProvider
- object ReplicatedShardingExtension extends ExtensionId[ReplicatedShardingExtension]
Extension for running Replicated Event Sourcing in sharding by starting one separate instance of sharding per replica.
Extension for running Replicated Event Sourcing in sharding by starting one separate instance of sharding per replica. The sharding instances can be confined to datacenters or cluster roles or run on the same set of cluster nodes.
- object ShardedDaemonProcessSettings
- object ShardingMessageExtractor
- object SliceRangeShardAllocationStrategy