public abstract class ShardCoordinator
extends java.lang.Object
implements akka.actor.Actor, akka.actor.ActorLogging
ClusterSharding extension
Modifier and Type | Class and Description |
---|---|
static class |
ShardCoordinator.AbstractShardAllocationStrategy
Java API: Java implementations of custom shard allocation and rebalancing logic used by the
ShardCoordinator
should extend this abstract class and implement the two methods. |
static class |
ShardCoordinator.Internal$
INTERNAL API
|
static class |
ShardCoordinator.LeastShardAllocationStrategy
The default implementation of
ShardCoordinator.LeastShardAllocationStrategy
allocates new shards to the ShardRegion with least number of previously allocated shards. |
static class |
ShardCoordinator.RebalanceWorker
INTERNAL API.
|
static interface |
ShardCoordinator.ShardAllocationStrategy
Interface of the pluggable shard allocation and rebalancing logic used by the
ShardCoordinator . |
Constructor and Description |
---|
ShardCoordinator(java.lang.String typeName,
ClusterShardingSettings settings,
akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy) |
Modifier and Type | Method and Description |
---|---|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
active() |
scala.collection.immutable.Set<akka.actor.ActorRef> |
aliveRegions() |
void |
allocateShardHomes() |
akka.cluster.Cluster |
cluster() |
void |
continueGetShardHome(java.lang.String shard,
akka.actor.ActorRef region,
akka.actor.ActorRef getShardHomeSender) |
void |
continueRebalance(scala.collection.immutable.Set<java.lang.String> shards) |
scala.collection.immutable.Set<akka.actor.ActorRef> |
gracefulShutdownInProgress() |
boolean |
isMember(akka.actor.ActorRef region) |
void |
postStop() |
static akka.actor.Props |
props(java.lang.String typeName,
ClusterShardingSettings settings,
akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy)
INTERNAL API
Factory method for the
Props of the ShardCoordinator actor. |
static akka.actor.Props |
props(java.lang.String typeName,
ClusterShardingSettings settings,
akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy,
akka.actor.ActorRef replicator)
INTERNAL API
Factory method for the
Props of the ShardCoordinator actor with state based on ddata. |
scala.collection.immutable.Set<java.lang.String> |
rebalanceInProgress() |
akka.actor.Cancellable |
rebalanceTask() |
static akka.actor.Props |
rebalanceWorkerProps(java.lang.String shard,
akka.actor.ActorRef from,
scala.concurrent.duration.FiniteDuration handOffTimeout,
scala.collection.immutable.Set<akka.actor.ActorRef> regions) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receiveTerminated() |
void |
regionProxyTerminated(akka.actor.ActorRef ref) |
void |
regionTerminated(akka.actor.ActorRef ref) |
scala.collection.immutable.Set<akka.actor.ActorRef> |
regionTerminationInProgress() |
scala.concurrent.duration.FiniteDuration |
removalMargin() |
void |
sendHostShardMsg(java.lang.String shard,
akka.actor.ActorRef region) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
shuttingDown() |
akka.cluster.sharding.ShardCoordinator.Internal.State |
state() |
void |
stateInitialized() |
scala.collection.immutable.Map<java.lang.String,akka.actor.Cancellable> |
unAckedHostShards() |
abstract <E extends akka.cluster.sharding.ShardCoordinator.Internal.DomainEvent> |
update(E evt,
scala.Function1<E,scala.runtime.BoxedUnit> f) |
void |
watchStateActors() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, preRestart, preStart, receive, self, sender, supervisorStrategy, unhandled
public ShardCoordinator(java.lang.String typeName, ClusterShardingSettings settings, akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy)
public static akka.actor.Props props(java.lang.String typeName, ClusterShardingSettings settings, akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy)
Props
of the ShardCoordinator
actor.typeName
- (undocumented)settings
- (undocumented)allocationStrategy
- (undocumented)public static akka.actor.Props props(java.lang.String typeName, ClusterShardingSettings settings, akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy, akka.actor.ActorRef replicator)
Props
of the ShardCoordinator
actor with state based on ddata.typeName
- (undocumented)settings
- (undocumented)allocationStrategy
- (undocumented)replicator
- (undocumented)public static akka.actor.Props rebalanceWorkerProps(java.lang.String shard, akka.actor.ActorRef from, scala.concurrent.duration.FiniteDuration handOffTimeout, scala.collection.immutable.Set<akka.actor.ActorRef> regions)
public akka.cluster.Cluster cluster()
public scala.concurrent.duration.FiniteDuration removalMargin()
public akka.cluster.sharding.ShardCoordinator.Internal.State state()
public scala.collection.immutable.Set<java.lang.String> rebalanceInProgress()
public scala.collection.immutable.Map<java.lang.String,akka.actor.Cancellable> unAckedHostShards()
public scala.collection.immutable.Set<akka.actor.ActorRef> gracefulShutdownInProgress()
public scala.collection.immutable.Set<akka.actor.ActorRef> aliveRegions()
public scala.collection.immutable.Set<akka.actor.ActorRef> regionTerminationInProgress()
public akka.actor.Cancellable rebalanceTask()
public void postStop()
postStop
in interface akka.actor.Actor
public boolean isMember(akka.actor.ActorRef region)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> active()
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveTerminated()
public abstract <E extends akka.cluster.sharding.ShardCoordinator.Internal.DomainEvent> void update(E evt, scala.Function1<E,scala.runtime.BoxedUnit> f)
public void watchStateActors()
public void stateInitialized()
public void regionTerminated(akka.actor.ActorRef ref)
public void regionProxyTerminated(akka.actor.ActorRef ref)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> shuttingDown()
public void sendHostShardMsg(java.lang.String shard, akka.actor.ActorRef region)
public void allocateShardHomes()
public void continueGetShardHome(java.lang.String shard, akka.actor.ActorRef region, akka.actor.ActorRef getShardHomeSender)
public void continueRebalance(scala.collection.immutable.Set<java.lang.String> shards)