Class ClusterShardingImpl
- java.lang.Object
-
- akka.cluster.sharding.typed.javadsl.ClusterSharding
-
- akka.cluster.sharding.typed.internal.ClusterShardingImpl
-
- All Implemented Interfaces:
Extension
,ClusterSharding
public final class ClusterShardingImpl extends ClusterSharding implements ClusterSharding
INTERNAL API
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.cluster.sharding.typed.javadsl.ClusterSharding
ClusterSharding.Passivate<M>, ClusterSharding.Passivate$, ClusterSharding.ShardCommand
-
Nested classes/interfaces inherited from interface akka.cluster.sharding.typed.scaladsl.ClusterSharding
ClusterSharding.Passivate<M>, ClusterSharding.Passivate$, ClusterSharding.ShardCommand
-
-
Constructor Summary
Constructors Constructor Description ClusterShardingImpl(ActorSystem<?> system)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShardCoordinator.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> 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)
<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-
Methods inherited from class akka.cluster.sharding.typed.javadsl.ClusterSharding
get
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.cluster.sharding.typed.scaladsl.ClusterSharding
asJava
-
-
-
-
Constructor Detail
-
ClusterShardingImpl
public ClusterShardingImpl(ActorSystem<?> system)
-
-
Method Detail
-
defaultShardAllocationStrategy
public ShardCoordinator.ShardAllocationStrategy defaultShardAllocationStrategy(ClusterShardingSettings settings)
Description copied from class:ClusterSharding
The default is currentlyShardCoordinator.LeastShardAllocationStrategy
with the givensettings
. This could be changed in the future.- Specified by:
defaultShardAllocationStrategy
in interfaceClusterSharding
- Specified by:
defaultShardAllocationStrategy
in classClusterSharding
- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-
entityRefFor
public <M> EntityRef<M> entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId)
Description copied from interface:ClusterSharding
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
.- Specified by:
entityRefFor
in interfaceClusterSharding
- Parameters:
typeKey
- (undocumented)entityId
- (undocumented)- Returns:
- (undocumented)
-
entityRefFor
public <M> EntityRef<M> entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId)
Description copied from class:ClusterSharding
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
.- Specified by:
entityRefFor
in classClusterSharding
- Parameters:
typeKey
- (undocumented)entityId
- (undocumented)- Returns:
- (undocumented)
-
init
public <M,E> ActorRef<E> init(Entity<M,E> entity)
Description copied from interface:ClusterSharding
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.
- Specified by:
init
in interfaceClusterSharding
- Parameters:
entity
- (undocumented)- Returns:
- (undocumented)
-
init
public <M,E> ActorRef<E> init(Entity<M,E> entity)
- Specified by:
init
in classClusterSharding
-
shardState
public ActorRef<ClusterShardingQuery> shardState()
Description copied from class:ClusterSharding
Actor for querying Cluster Sharding state- Specified by:
shardState
in interfaceClusterSharding
- Specified by:
shardState
in classClusterSharding
- Returns:
- (undocumented)
-
-