object ShardRegion

Source
ShardRegion.scala
See also

ClusterSharding extension

Linear Supertypes
Content Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ShardRegion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class ClusterShardingStats(regions: Map[Address, ShardRegionStats]) extends ClusterShardingSerializable with Product with Serializable

    Reply to GetClusterShardingStats, contains statistics about all the sharding regions in the cluster.

    Reply to GetClusterShardingStats, contains statistics about all the sharding regions in the cluster.

    Annotations
    @SerialVersionUID()
  2. final case class CurrentRegions(regions: Set[Address]) extends ClusterShardingSerializable with Product with Serializable

    Reply to GetCurrentRegions

    Reply to GetCurrentRegions

    Annotations
    @SerialVersionUID()
  3. final class CurrentShardRegionState extends ClusterShardingSerializable with Product

    Reply to GetShardRegionState$

    Reply to GetShardRegionState$

    If gathering the shard information times out the set of shards will be empty.

    Annotations
    @SerialVersionUID()
  4. type EntityId = String

    Marker type of entity identifier (String).

  5. type ExtractEntityId = PartialFunction[Msg, (EntityId, Msg)]

    Interface of the partial function used by the ShardRegion to extract the entity id and the message to send to the entity from an incoming message.

    Interface of the partial function used by the ShardRegion to extract the entity id and the message to send to the entity from an incoming message. The implementation is application specific. If the partial function does not match the message will be unhandled, i.e. posted as Unhandled messages on the event stream. Note that the extracted message does not have to be the same as the incoming message to support wrapping in message envelope that is unwrapped before sending to the entity actor.

  6. type ExtractShardId = (Msg) => ShardId

    Interface of the function used by the ShardRegion to extract the shard id from an incoming message.

    Interface of the function used by the ShardRegion to extract the shard id from an incoming message. Only messages that passed the ExtractEntityId will be used as input to this function.

  7. case class GetClusterShardingStats(timeout: FiniteDuration) extends ShardRegionQuery with ClusterShardingSerializable with Product with Serializable

    Send this message to the ShardRegion actor to request for ClusterShardingStats, which contains statistics about the currently running sharded entities in the entire cluster.

    Send this message to the ShardRegion actor to request for ClusterShardingStats, which contains statistics about the currently running sharded entities in the entire cluster. If the 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.

    Annotations
    @SerialVersionUID()
  8. abstract class HashCodeMessageExtractor extends MessageExtractor

    Convenience implementation of ShardRegion.MessageExtractor that construct shardId based on the hashCode of the entityId.

    Convenience implementation of ShardRegion.MessageExtractor that construct shardId based on the hashCode of the entityId. The number of unique shards is limited by the given maxNumberOfShards.

  9. trait MessageExtractor extends AnyRef

    Java API: Interface of functions to extract entity id, shard id, and the message to send to the entity from an incoming message.

  10. type Msg = Any

    Marker type of application messages (Any).

  11. final case class Passivate(stopMessage: Any) extends ShardRegionCommand with Product with Serializable

    If the state of the entities are persistent you may stop entities that are not used to reduce memory consumption.

    If the state of the entities are persistent you may stop entities that are not used to reduce memory consumption. This is done by the application specific implementation of the entity actors for example by defining receive timeout (context.setReceiveTimeout). If a message is already enqueued to the entity when it stops itself the enqueued message in the mailbox will be dropped. To support graceful passivation without losing such messages the entity actor can send this Passivate message to its parent ShardRegion. The specified wrapped stopMessage will be sent back to the entity, which is then supposed to stop itself. Incoming messages will be buffered by the ShardRegion between reception of Passivate and termination of the entity. Such buffered messages are thereafter delivered to a new incarnation of the entity.

    akka.actor.PoisonPill is a perfectly fine stopMessage.

    Annotations
    @SerialVersionUID()
  12. final case class SetActiveEntityLimit(perRegionLimit: Int) extends Product with Serializable

    API MAY CHANGE: Messages for passivation strategies may change after additional testing and feedback.

    API MAY CHANGE: Messages for passivation strategies may change after additional testing and feedback.

    When limit-based automatic passivation is enabled, set a new active entity limit for a shard region.

    Annotations
    @ApiMayChange()
  13. type ShardId = String

    Marker type of shard identifier (String).

  14. final case class ShardInitialized(shardId: ShardId) extends Product with Serializable

    We must be sure that a shard is initialized before to start send messages to it.

    We must be sure that a shard is initialized before to start send messages to it. Shard could be terminated during initialization.

  15. sealed trait ShardRegionCommand extends AnyRef
  16. sealed trait ShardRegionQuery extends AnyRef
  17. final class ShardRegionStats extends ClusterShardingSerializable with Product

    Annotations
    @SerialVersionUID()
  18. final case class ShardState(shardId: ShardId, entityIds: Set[EntityId]) extends Product with Serializable
    Annotations
    @SerialVersionUID()
  19. final case class StartEntity(entityId: EntityId) extends ClusterShardingSerializable with Product with Serializable

    When remembering entities and a shard is started, each entity id that needs to be running will trigger this message being sent through sharding.

    When remembering entities and a shard is started, each entity id that needs to be running will trigger this message being sent through sharding. For this to work the message *must* be handled by the shard id extractor.

  20. final case class StartEntityAck(entityId: EntityId, shardId: ShardId) extends ClusterShardingSerializable with DeadLetterSuppression with Product with Serializable

    Sent back when a ShardRegion.StartEntity message was received and triggered the entity to start (it does not guarantee the entity successfully started)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  9. def getCurrentRegionsInstance: GetCurrentRegions.type

    Java API: Send this message to the ShardRegion actor to request for CurrentRegions, which contains the addresses of all registered regions.

    Java API: Send this message to the ShardRegion actor to request for CurrentRegions, which contains the addresses of all registered regions.

    Intended for testing purpose to see when cluster sharding is "ready" or to monitor the state of the shard regions.

  10. def getRegionStatsInstance: GetShardRegionStats

    Java API:

  11. def getShardRegionStateInstance: GetShardRegionState

    Java API:

  12. def gracefulShutdownInstance: GracefulShutdown

    Java API: Send this message to the ShardRegion actor to handoff all shards that are hosted by the ShardRegion and then the ShardRegion actor will be stopped.

    Java API: Send this message to the ShardRegion actor to handoff all shards that are hosted by the ShardRegion and then the ShardRegion actor will be stopped. You can watch it to know when it is completed.

  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. object CurrentShardRegionState extends AbstractFunction1[Set[ShardState], CurrentShardRegionState] with Serializable
  24. case object GetCurrentRegions extends ShardRegionQuery with ClusterShardingSerializable with Product with Serializable

    Send this message to the ShardRegion actor to request for CurrentRegions, which contains the addresses of all registered regions.

    Send this message to the ShardRegion actor to request for CurrentRegions, which contains the addresses of all registered regions.

    Intended for testing purpose to see when cluster sharding is "ready" or to monitor the state of the shard regions.

    Annotations
    @SerialVersionUID()
  25. case object GetShardRegionState extends ShardRegionQuery with ClusterShardingSerializable with Product with Serializable

    Send this message to a ShardRegion actor instance to request a CurrentShardRegionState which describes the current state of the region.

    Send this message to a ShardRegion actor instance to request a CurrentShardRegionState which describes the current state of the region. The state contains information about what shards are running in this region and what entities are running on each of those shards.

    Annotations
    @SerialVersionUID()
  26. case object GetShardRegionStats extends ShardRegionQuery with ClusterShardingSerializable with Product with Serializable

    Send this message to the ShardRegion actor to request for ShardRegionStats, which contains statistics about the currently running sharded entities in the entire region.

    Send this message to the ShardRegion actor to request for ShardRegionStats, which contains statistics about the currently running sharded entities in the entire region.

    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$.

    Annotations
    @SerialVersionUID()
  27. case object GracefulShutdown extends ShardRegionCommand with Product with Serializable
    Annotations
    @SerialVersionUID()
  28. object HashCodeMessageExtractor
  29. object ShardRegionStats extends AbstractFunction1[Map[ShardId, Int], ShardRegionStats] with Serializable

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped