object ShardRegion
- Alphabetic
- By Inheritance
- ShardRegion
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
ClusterShardingStats
(regions: Map[Address, ShardRegionStats]) extends 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()
-
final
case class
CurrentRegions
(regions: Set[Address]) extends Product with Serializable
Reply to
GetCurrentRegions
Reply to
GetCurrentRegions
- Annotations
- @SerialVersionUID()
-
final
case class
CurrentShardRegionState
(shards: Set[ShardState]) extends Product with Serializable
Reply to GetShardRegionState$
Reply to GetShardRegionState$
If gathering the shard information times out the set of shards will be empty.
- Annotations
- @SerialVersionUID()
-
type
EntityId = String
Marker type of entity identifier (
String
). -
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 asUnhandled
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. -
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.
-
case class
GetClusterShardingStats
(timeout: FiniteDuration) extends ShardRegionQuery 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 thetimeout
is reached without answers from all shard regions the reply will contain an emmpty 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()
-
abstract
class
HashCodeMessageExtractor
extends MessageExtractor
Convenience implementation of ShardRegion.MessageExtractor that construct
shardId
based on thehashCode
of theentityId
.Convenience implementation of ShardRegion.MessageExtractor that construct
shardId
based on thehashCode
of theentityId
. The number of unique shards is limited by the givenmaxNumberOfShards
. -
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.
-
type
Msg = Any
Marker type of application messages (
Any
). -
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 thisPassivate
message to its parentShardRegion
. The specified wrappedstopMessage
will be sent back to the entity, which is then supposed to stop itself. Incoming messages will be buffered by theShardRegion
between reception ofPassivate
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()
-
type
ShardId = String
Marker type of shard identifier (
String
). -
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.
- sealed trait ShardRegionCommand extends AnyRef
- sealed trait ShardRegionQuery extends AnyRef
-
final
case class
ShardRegionStats
(stats: Map[ShardId, Int]) extends Product with Serializable
- Annotations
- @SerialVersionUID()
-
final
case class
ShardState
(shardId: ShardId, entityIds: Set[EntityId]) extends Product with Serializable
- Annotations
- @SerialVersionUID()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getCurrentRegionsInstance: GetCurrentRegions.type
Java API:
-
def
getRegionStatsInstance: GetShardRegionStats.type
Java API:
-
def
getShardRegionStateInstance: GetShardRegionState.type
Java API:
-
def
gracefulShutdownInstance: GracefulShutdown.type
Java API: Send this message to the
ShardRegion
actor to handoff all shards that are hosted by theShardRegion
and then theShardRegion
actor will be stopped.Java API: Send this message to the
ShardRegion
actor to handoff all shards that are hosted by theShardRegion
and then theShardRegion
actor will be stopped. You canwatch
it to know when it is completed. -
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
object
GetCurrentRegions
extends ShardRegionQuery 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()
-
object
GetShardRegionState
extends ShardRegionQuery 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()
-
object
GetShardRegionStats
extends ShardRegionQuery 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()
-
object
GracefulShutdown
extends ShardRegionCommand with Product with Serializable
- Annotations
- @SerialVersionUID()