Class ExternalShardAllocationClientImpl
- java.lang.Object
-
- akka.cluster.sharding.external.internal.ExternalShardAllocationClientImpl
-
- All Implemented Interfaces:
ExternalShardAllocationClient
,ExternalShardAllocationClient
public final class ExternalShardAllocationClientImpl extends java.lang.Object implements ExternalShardAllocationClient, ExternalShardAllocationClient
INTERNAL API
-
-
Constructor Summary
Constructors Constructor Description ExternalShardAllocationClientImpl(ActorSystem system, java.lang.String typeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<ShardLocations>
getShardLocations()
Get all the current shard locations that have been set via setShardLocationjava.util.concurrent.CompletionStage<Done>
setShardLocation(java.lang.String shard, Address location)
Update the given shard's location.java.util.concurrent.CompletionStage<Done>
setShardLocations(java.util.Map<java.lang.String,Address> locations)
Update all of the provided ShardLocations.scala.concurrent.Future<ShardLocations>
shardLocations()
Get all the current shard locations that have been set via updateShardLocationscala.concurrent.Future<Done>
updateShardLocation(java.lang.String shard, Address location)
Update the given shard's location.scala.concurrent.Future<Done>
updateShardLocations(scala.collection.immutable.Map<java.lang.String,Address> locations)
Update all of the provided ShardLocations.
-
-
-
Constructor Detail
-
ExternalShardAllocationClientImpl
public ExternalShardAllocationClientImpl(ActorSystem system, java.lang.String typeName)
-
-
Method Detail
-
getShardLocations
public java.util.concurrent.CompletionStage<ShardLocations> getShardLocations()
Description copied from interface:ExternalShardAllocationClient
Get all the current shard locations that have been set via setShardLocation- Specified by:
getShardLocations
in interfaceExternalShardAllocationClient
-
setShardLocation
public java.util.concurrent.CompletionStage<Done> setShardLocation(java.lang.String shard, Address location)
Description copied from interface:ExternalShardAllocationClient
Update the given shard's location. TheAddress
should match one of the nodes in the cluster. If the node has not joined the cluster yet it will be moved to that node after the first cluster sharding rebalance.- Specified by:
setShardLocation
in interfaceExternalShardAllocationClient
- Parameters:
shard
- The shard identifierlocation
- Location (akka node) to allocate the shard to- Returns:
- Conformation that the update has been written to the local node
-
setShardLocations
public java.util.concurrent.CompletionStage<Done> setShardLocations(java.util.Map<java.lang.String,Address> locations)
Description copied from interface:ExternalShardAllocationClient
Update all of the provided ShardLocations. TheAddress
should match one of the nodes in the cluster. If the node has not joined the cluster yet it will be moved to that node after the first cluster sharding rebalance it does.- Specified by:
setShardLocations
in interfaceExternalShardAllocationClient
- Parameters:
locations
- to update- Returns:
- Confirmation that the update has been written to the local node
-
shardLocations
public scala.concurrent.Future<ShardLocations> shardLocations()
Description copied from interface:ExternalShardAllocationClient
Get all the current shard locations that have been set via updateShardLocation- Specified by:
shardLocations
in interfaceExternalShardAllocationClient
-
updateShardLocation
public scala.concurrent.Future<Done> updateShardLocation(java.lang.String shard, Address location)
Description copied from interface:ExternalShardAllocationClient
Update the given shard's location. TheAddress
should match one of the nodes in the cluster. If the node has not joined the cluster yet it will be moved to that node after the first cluster sharding rebalance it does.- Specified by:
updateShardLocation
in interfaceExternalShardAllocationClient
- Parameters:
shard
- The shard identifierlocation
- Location (akka node) to allocate the shard to- Returns:
- Confirmation that the update has been propagated to a majority of cluster nodes
-
updateShardLocations
public scala.concurrent.Future<Done> updateShardLocations(scala.collection.immutable.Map<java.lang.String,Address> locations)
Description copied from interface:ExternalShardAllocationClient
Update all of the provided ShardLocations. TheAddress
should match one of the nodes in the cluster. If the node has not joined the cluster yet it will be moved to that node after the first cluster sharding rebalance it does.- Specified by:
updateShardLocations
in interfaceExternalShardAllocationClient
- Parameters:
locations
- to update- Returns:
- Confirmation that the update has been propagates to a majority of cluster nodes
-
-