Interface ClusterSharding
-
- Type Parameters:
M
- The type of message the entity acceptsE
- A possible envelope around the message the entity accepts
- All Superinterfaces:
Extension
- All Known Implementing Classes:
ClusterShardingImpl
public interface ClusterSharding extends Extension
Initialize sharding for the givenentity
factory settings.It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClusterSharding.Passivate<M>
static class
ClusterSharding.Passivate$
static interface
ClusterSharding.ShardCommand
When an entity is created anActorRef[ShardCommand]
is passed to the factory method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClusterSharding
asJava()
INTERNAL APIShardCoordinator.ShardAllocationStrategy
defaultShardAllocationStrategy(ClusterShardingSettings settings)
The default is currentlyShardCoordinator.LeastShardAllocationStrategy
with the givensettings
.<M> EntityRef<M>
entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId)
Create anActorRef
-like reference to a specific sharded entity.<M,E>
ActorRef<E>init(Entity<M,E> entity)
Initialize sharding for the givenentity
factory settings.ActorRef<ClusterShardingQuery>
shardState()
Actor for querying Cluster Sharding state
-
-
-
Method Detail
-
init
<M,E> ActorRef<E> init(Entity<M,E> entity)
Initialize sharding for the givenentity
factory settings.It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.
- Parameters:
entity
- (undocumented)- Returns:
- (undocumented)
-
entityRefFor
<M> EntityRef<M> entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId)
Create anActorRef
-like reference to a specific sharded entity. Currently you have to correctly specify the type of messages the target can handle.Messages sent through this
EntityRef
will be wrapped in aShardingEnvelope
including the here providedentityId
.For in-depth documentation of its semantics, see
EntityRef
.- Parameters:
typeKey
- (undocumented)entityId
- (undocumented)- Returns:
- (undocumented)
-
shardState
ActorRef<ClusterShardingQuery> shardState()
Actor for querying Cluster Sharding state- Returns:
- (undocumented)
-
defaultShardAllocationStrategy
ShardCoordinator.ShardAllocationStrategy defaultShardAllocationStrategy(ClusterShardingSettings settings)
The default is currentlyShardCoordinator.LeastShardAllocationStrategy
with the givensettings
. This could be changed in the future.- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-
asJava
ClusterSharding asJava()
INTERNAL API- Returns:
- (undocumented)
-
-