Package akka.cluster
Class ClusterRemoteWatcher
- java.lang.Object
-
- akka.remote.RemoteWatcher
-
- akka.cluster.ClusterRemoteWatcher
-
- All Implemented Interfaces:
Actor
,ActorLogging
,Timers
,RequiresMessageQueue<UnboundedMessageQueueSemantics>
public class ClusterRemoteWatcher extends RemoteWatcher implements Timers
INTERNAL APISpecialization of
RemoteWatcher
that keeps track of cluster member nodes and is responsible for watchees on cluster nodes.AddressTerminated
is published when node is removed from cluster.RemoteWatcher
handles non-cluster nodes.ClusterRemoteWatcher
will take over responsibility fromRemoteWatcher
if a watch is added before a node is member of the cluster and then later becomes cluster member.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.remote.RemoteWatcher
RemoteWatcher.ArteryHeartbeat$, RemoteWatcher.ArteryHeartbeatRsp, RemoteWatcher.ArteryHeartbeatRsp$, RemoteWatcher.ExpectedFirstHeartbeat, RemoteWatcher.ExpectedFirstHeartbeat$, RemoteWatcher.Heartbeat$, RemoteWatcher.HeartbeatRsp, RemoteWatcher.HeartbeatRsp$, RemoteWatcher.HeartbeatTick$, RemoteWatcher.ReapUnreachableTick$, RemoteWatcher.Stats, RemoteWatcher.Stats$, RemoteWatcher.UnwatchRemote, RemoteWatcher.UnwatchRemote$, RemoteWatcher.WatchRemote, RemoteWatcher.WatchRemote$
-
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$
-
-
Constructor Summary
Constructors Constructor Description ClusterRemoteWatcher(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWatch(InternalActorRef watchee, InternalActorRef watcher)
Cluster
cluster()
scala.collection.immutable.Set<Address>
clusterNodes()
void
clusterNodes_$eq(scala.collection.immutable.Set<Address> x$1)
void
delayedQuarantine(Member m, MemberStatus previousStatus)
LoggingAdapter
log()
void
memberRemoved(Member m, MemberStatus previousStatus)
scala.collection.immutable.Set<UniqueAddress>
memberTombstones()
void
memberTombstones_$eq(scala.collection.immutable.Set<UniqueAddress> x$1)
void
memberUp(Member m)
void
postStop()
User overridable callback.void
preStart()
User overridable callback.static Props
props(FailureDetectorRegistry<Address> failureDetector, RemoteSettings settings)
Factory method forClusterRemoteWatcher
Props
.void
quarantineOldIncarnation(Member newIncarnation)
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receive()
Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>
receiveClusterEvent()
protected boolean
shouldWatch(InternalActorRef watchee)
Returns true if either has cluster orakka.remote.use-unsafe-remote-features-outside-cluster
is enabled.void
takeOverResponsibility(Address address)
When a cluster node is added this class takes over the responsibility for watchees on that node already handled by super RemoteWatcher.void
watchNode(InternalActorRef watchee)
-
Methods inherited from class akka.remote.RemoteWatcher
addressUids, addressUids_$eq, akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, artery, context, failureDetectorReaperTask, heartBeatMsg, heartbeatTask, props, publishAddressTerminated, quarantine, reapUnreachable, receiveHeartbeat, receiveHeartbeatRsp, remoteProvider, removeWatch, removeWatchee, reWatch, scheduler, self, selfHeartbeatRspMsg, sendHeartbeat, terminated, triggerFirstHeartbeat, unreachable, unreachable_$eq, unwatchNode, watcheeByNodes, watching, watchingNodes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.actor.Actor
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPreStart, context, postRestart, preRestart, self, sender, supervisorStrategy, unhandled
-
Methods inherited from interface akka.actor.ActorLogging
_log_$eq
-
Methods inherited from interface akka.actor.Timers
actorCell, aroundPostStop, aroundPreRestart, aroundReceive, super$aroundPostStop, super$aroundPreRestart, super$aroundReceive, timers
-
-
-
-
Constructor Detail
-
ClusterRemoteWatcher
public ClusterRemoteWatcher(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
-
-
Method Detail
-
props
public static Props props(FailureDetectorRegistry<Address> failureDetector, RemoteSettings settings)
Factory method forClusterRemoteWatcher
Props
.
-
cluster
public Cluster cluster()
-
log
public LoggingAdapter log()
- Specified by:
log
in interfaceActorLogging
-
clusterNodes
public scala.collection.immutable.Set<Address> clusterNodes()
-
clusterNodes_$eq
public void clusterNodes_$eq(scala.collection.immutable.Set<Address> x$1)
-
memberTombstones
public scala.collection.immutable.Set<UniqueAddress> memberTombstones()
-
memberTombstones_$eq
public void memberTombstones_$eq(scala.collection.immutable.Set<UniqueAddress> x$1)
-
preStart
public void preStart()
Description copied from interface:Actor
User overridable callback. Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.
-
postStop
public void postStop()
Description copied from interface:Actor
User overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.- Specified by:
postStop
in interfaceActor
- Overrides:
postStop
in classRemoteWatcher
-
receive
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Description copied from interface:Actor
Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.- Specified by:
receive
in interfaceActor
- Overrides:
receive
in classRemoteWatcher
-
receiveClusterEvent
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receiveClusterEvent()
-
memberUp
public void memberUp(Member m)
-
memberRemoved
public void memberRemoved(Member m, MemberStatus previousStatus)
-
quarantineOldIncarnation
public void quarantineOldIncarnation(Member newIncarnation)
-
delayedQuarantine
public void delayedQuarantine(Member m, MemberStatus previousStatus)
-
addWatch
public void addWatch(InternalActorRef watchee, InternalActorRef watcher)
- Overrides:
addWatch
in classRemoteWatcher
-
watchNode
public void watchNode(InternalActorRef watchee)
- Overrides:
watchNode
in classRemoteWatcher
-
shouldWatch
protected boolean shouldWatch(InternalActorRef watchee)
Description copied from class:RemoteWatcher
Returns true if either has cluster orakka.remote.use-unsafe-remote-features-outside-cluster
is enabled. Can be overridden when using RemoteWatcher as a superclass.- Overrides:
shouldWatch
in classRemoteWatcher
-
takeOverResponsibility
public void takeOverResponsibility(Address address)
When a cluster node is added this class takes over the responsibility for watchees on that node already handled by super RemoteWatcher.
-
-