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 defaultShardAllocationStrategy
is configured byleast-shard-allocation-strategy
properties.<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, java.lang.String dataCenter)
Create anActorRef
-like reference to a specific sharded entity running in another data center.<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, java.lang.String dataCenter)
Create anActorRef
-like reference to a specific sharded entity running in another data center.<M,E>
ActorRef<E>init(Entity<M,E> entity)
Initialize sharding for the givenentity
factory settings.<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 defaultShardAllocationStrategy
is configured byleast-shard-allocation-strategy
properties.- Specified by:
defaultShardAllocationStrategy
in interfaceClusterSharding
- Specified by:
defaultShardAllocationStrategy
in classClusterSharding
-
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.You have to correctly specify the type of messages the target can handle via the
typeKey
.Messages sent through this
EntityRef
will be wrapped in aShardingEnvelope
including the here providedentityId
.This can only be used if the default
ShardingEnvelope
is used, when using custom envelopes or in message entity ids you will need to use theActorRef[E]
returned by sharding init for messaging with the sharded actors.For in-depth documentation of its semantics, see
EntityRef
.- Specified by:
entityRefFor
in interfaceClusterSharding
-
entityRefFor
public <M> EntityRef<M> entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId, java.lang.String dataCenter)
Description copied from interface:ClusterSharding
Create anActorRef
-like reference to a specific sharded entity running in another data center.You have to correctly specify the type of messages the target can handle via the
typeKey
.Messages sent through this
EntityRef
will be wrapped in aShardingEnvelope
including the here providedentityId
.This can only be used if the default
ShardingEnvelope
is used, when using custom envelopes or in message entity ids you will need to use theActorRef[E]
returned by sharding init for messaging with the sharded actors.For in-depth documentation of its semantics, see
EntityRef
.- Specified by:
entityRefFor
in interfaceClusterSharding
-
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.You have to correctly specify the type of messages the target can handle via the
typeKey
.Messages sent through this
EntityRef
will be wrapped in aShardingEnvelope
including the here providedentityId
.This can only be used if the default
ShardingEnvelope
is used, when using custom envelopes or in message entity ids you will need to use theActorRef<E>
returned by sharding init for messaging with the sharded actors.For in-depth documentation of its semantics, see
EntityRef
.- Specified by:
entityRefFor
in classClusterSharding
-
entityRefFor
public <M> EntityRef<M> entityRefFor(EntityTypeKey<M> typeKey, java.lang.String entityId, java.lang.String dataCenter)
Description copied from class:ClusterSharding
Create anActorRef
-like reference to a specific sharded entity running in another data center.You have to correctly specify the type of messages the target can handle via the
typeKey
.Messages sent through this
EntityRef
will be wrapped in aShardingEnvelope
including the providedentityId
.This can only be used if the default
ShardingEnvelope
is used, when using custom envelopes or in message entity ids you will need to use theActorRef[E]
returned by sharding init for messaging with the sharded actors.For in-depth documentation of its semantics, see
EntityRef
.- Specified by:
entityRefFor
in classClusterSharding
-
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
-
init
public <M,E> ActorRef<E> init(Entity<M,E> entity)
Description copied from class: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 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
-
-