public abstract class ShardCoordinator extends java.lang.Object implements 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 . |
Actor.emptyBehavior$, Actor.ignoringBehavior$
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() |
protected abstract static void |
akka$actor$Actor$_setter_$context_$eq(ActorContext x$1) |
protected abstract static void |
akka$actor$Actor$_setter_$self_$eq(ActorRef x$1) |
static void |
akka$actor$ActorLogging$$_log_$eq(LoggingAdapter x$1) |
static LoggingAdapter |
akka$actor$ActorLogging$$_log() |
scala.collection.immutable.Set<ActorRef> |
aliveRegions() |
void |
allocateShardHomesForRememberEntities() |
boolean |
allRegionsRegistered() |
protected static void |
aroundPostRestart(java.lang.Throwable reason) |
protected static void |
aroundPostStop() |
protected static void |
aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
protected static void |
aroundPreStart() |
protected static void |
aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object msg) |
Cluster |
cluster() |
ActorContext |
context()
Stores the context for this actor, including self, and sender.
|
void |
continueGetShardHome(java.lang.String shard,
ActorRef region,
ActorRef getShardHomeSender) |
void |
continueRebalance(scala.collection.immutable.Set<java.lang.String> shards) |
scala.collection.immutable.Set<ActorRef> |
gracefulShutdownInProgress() |
boolean |
hasAllRegionsRegistered() |
boolean |
isMember(ActorRef region) |
static LoggingAdapter |
log() |
int |
minMembers() |
static void |
postRestart(java.lang.Throwable reason) |
void |
postStop()
User overridable callback.
|
static void |
preRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message) |
static void |
preStart() |
static 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 Props |
props(java.lang.String typeName,
ClusterShardingSettings settings,
akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy,
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() |
Cancellable |
rebalanceTask() |
static Props |
rebalanceWorkerProps(java.lang.String shard,
ActorRef from,
scala.concurrent.duration.FiniteDuration handOffTimeout,
scala.collection.immutable.Set<ActorRef> regions) |
abstract static scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive() |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receiveTerminated() |
void |
regionProxyTerminated(ActorRef ref) |
void |
regionTerminated(ActorRef ref) |
scala.collection.immutable.Set<ActorRef> |
regionTerminationInProgress() |
scala.concurrent.duration.FiniteDuration |
removalMargin() |
ActorRef |
self()
The 'self' field holds the ActorRef for this actor.
|
static ActorRef |
sender() |
void |
sendHostShardMsg(java.lang.String shard,
ActorRef region) |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
shuttingDown() |
akka.cluster.sharding.ShardCoordinator.Internal.State |
state() |
void |
stateInitialized() |
static SupervisorStrategy |
supervisorStrategy() |
scala.collection.immutable.Map<java.lang.String,Cancellable> |
unAckedHostShards() |
static void |
unhandled(java.lang.Object message) |
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
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, preRestart, preStart, receive, sender, supervisorStrategy, unhandled
log
public ShardCoordinator(java.lang.String typeName, ClusterShardingSettings settings, akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy)
public static 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 Props props(java.lang.String typeName, ClusterShardingSettings settings, akka.cluster.sharding.ShardCoordinator.ShardAllocationStrategy allocationStrategy, ActorRef replicator)
Props
of the ShardCoordinator
actor with state based on ddata.typeName
- (undocumented)settings
- (undocumented)allocationStrategy
- (undocumented)replicator
- (undocumented)public static Props rebalanceWorkerProps(java.lang.String shard, ActorRef from, scala.concurrent.duration.FiniteDuration handOffTimeout, scala.collection.immutable.Set<ActorRef> regions)
public static final ActorRef sender()
public abstract static scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
protected static void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Object msg)
protected static void aroundPreStart()
protected static void aroundPostStop()
protected static void aroundPreRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
protected static void aroundPostRestart(java.lang.Throwable reason)
public static SupervisorStrategy supervisorStrategy()
public static void preStart() throws java.lang.Exception
java.lang.Exception
public static void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message) throws java.lang.Exception
java.lang.Exception
public static void postRestart(java.lang.Throwable reason) throws java.lang.Exception
java.lang.Exception
public static void unhandled(java.lang.Object message)
protected abstract static void akka$actor$Actor$_setter_$context_$eq(ActorContext x$1)
protected abstract static void akka$actor$Actor$_setter_$self_$eq(ActorRef x$1)
public static LoggingAdapter akka$actor$ActorLogging$$_log()
public static void akka$actor$ActorLogging$$_log_$eq(LoggingAdapter x$1)
public static LoggingAdapter log()
public ActorContext context()
Actor
forward
.
WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
ActorContext
is the Scala API. getContext
returns a
UntypedActorContext
, which is the Java API of the actor
context.
public final ActorRef self()
Actor
self ! message
public Cluster cluster()
public scala.concurrent.duration.FiniteDuration removalMargin()
public int minMembers()
public boolean allRegionsRegistered()
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,Cancellable> unAckedHostShards()
public scala.collection.immutable.Set<ActorRef> gracefulShutdownInProgress()
public scala.collection.immutable.Set<ActorRef> aliveRegions()
public scala.collection.immutable.Set<ActorRef> regionTerminationInProgress()
public Cancellable rebalanceTask()
public void postStop()
Actor
public boolean isMember(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 boolean hasAllRegionsRegistered()
public void regionTerminated(ActorRef ref)
public void regionProxyTerminated(ActorRef ref)
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> shuttingDown()
public void sendHostShardMsg(java.lang.String shard, ActorRef region)
public void allocateShardHomesForRememberEntities()
public void continueGetShardHome(java.lang.String shard, ActorRef region, ActorRef getShardHomeSender)
public void continueRebalance(scala.collection.immutable.Set<java.lang.String> shards)