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 givenentityfactory 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 classClusterSharding.Passivate<M>static classClusterSharding.Passivate$static interfaceClusterSharding.ShardCommandWhen 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 ClusterShardingasJava()INTERNAL APIShardCoordinator.ShardAllocationStrategydefaultShardAllocationStrategy(ClusterShardingSettings settings)The default is currentlyShardCoordinator.LeastShardAllocationStrategywith 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 givenentityfactory 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 givenentityfactory 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
EntityRefwill be wrapped in aShardingEnvelopeincluding 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.LeastShardAllocationStrategywith the givensettings. This could be changed in the future.- Parameters:
settings- (undocumented)- Returns:
- (undocumented)
-
asJava
ClusterSharding asJava()
INTERNAL API- Returns:
- (undocumented)
-
-