Class ExternalShardAllocationClientImpl

    • 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 setShardLocation
      java.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 updateShardLocation
      scala.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExternalShardAllocationClientImpl

        public ExternalShardAllocationClientImpl​(ActorSystem system,
                                                 java.lang.String typeName)
    • Method Detail

      • 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. The Address 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 interface ExternalShardAllocationClient
        Parameters:
        shard - The shard identifier
        location - 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. The Address 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 interface ExternalShardAllocationClient
        Parameters:
        locations - to update
        Returns:
        Confirmation that the update has been written to the local node
      • updateShardLocation

        public scala.concurrent.Future<Done> updateShardLocation​(java.lang.String shard,
                                                                 Address location)
        Description copied from interface: ExternalShardAllocationClient
        Update the given shard's location. The Address 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 interface ExternalShardAllocationClient
        Parameters:
        shard - The shard identifier
        location - 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. The Address 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 interface ExternalShardAllocationClient
        Parameters:
        locations - to update
        Returns:
        Confirmation that the update has been propagates to a majority of cluster nodes