public class RemoteWatcher
extends java.lang.Object
implements akka.actor.Actor, akka.actor.ActorLogging, akka.dispatch.RequiresMessageQueue<akka.dispatch.UnboundedMessageQueueSemantics>
Remote nodes with actors that are watched are monitored by this actor to be able
to detect network failures and JVM crashes. RemoteActorRefProvider
intercepts Watch and Unwatch system messages and sends corresponding
RemoteWatcher.WatchRemote and RemoteWatcher.UnwatchRemote to this actor.
For a new node to be watched this actor periodically sends RemoteWatcher.Heartbeat
to the peer actor on the other node, which replies with RemoteWatcher.HeartbeatRsp
message back. The failure detector on the watching side monitors these heartbeat messages.
If arrival of hearbeat messages stops it will be detected and this actor will publish
AddressTerminated to the AddressTerminatedTopic.
When all actors on a node have been unwatched it will stop sending heartbeat messages.
For bi-directional watch between two nodes the same thing will be established in both directions, but independent of each other.
| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteWatcher.ExpectedFirstHeartbeat |
static class |
RemoteWatcher.ExpectedFirstHeartbeat$ |
static class |
RemoteWatcher.Heartbeat$ |
static class |
RemoteWatcher.HeartbeatRsp |
static class |
RemoteWatcher.HeartbeatRsp$ |
static class |
RemoteWatcher.HeartbeatTick$ |
static class |
RemoteWatcher.ReapUnreachableTick$ |
static class |
RemoteWatcher.Rewatch |
static class |
RemoteWatcher.RewatchRemote |
static class |
RemoteWatcher.RewatchRemote$ |
static class |
RemoteWatcher.Stats |
static class |
RemoteWatcher.Stats$ |
static class |
RemoteWatcher.UnwatchRemote |
static class |
RemoteWatcher.UnwatchRemote$ |
static class |
RemoteWatcher.WatchRemote |
static class |
RemoteWatcher.WatchRemote$ |
| Constructor and Description |
|---|
RemoteWatcher(FailureDetectorRegistry<akka.actor.Address> failureDetector,
scala.concurrent.duration.FiniteDuration heartbeatInterval,
scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter) |
| Modifier and Type | Method and Description |
|---|---|
scala.collection.immutable.Map<akka.actor.Address,java.lang.Object> |
addressUids() |
void |
addWatching(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher) |
void |
checkLastUnwatchOfNode(akka.actor.Address watcheeAddress) |
akka.actor.Cancellable |
failureDetectorReaperTask() |
akka.actor.Cancellable |
heartbeatTask() |
void |
logActorForDeprecationWarning(akka.actor.ActorRef watchee) |
void |
postStop() |
static akka.actor.Props |
props(FailureDetectorRegistry<akka.actor.Address> failureDetector,
scala.concurrent.duration.FiniteDuration heartbeatInterval,
scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
Factory method for
RemoteWatcher Props. |
void |
publishAddressTerminated(akka.actor.Address address) |
void |
quarantine(akka.actor.Address address,
scala.Option<java.lang.Object> uid) |
void |
reapUnreachable() |
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive() |
void |
receiveHeartbeat() |
void |
receiveHeartbeatRsp(int uid) |
RemoteActorRefProvider |
remoteProvider() |
void |
reWatch(akka.actor.Address address)
To ensure that we receive heartbeat messages from the right actor system
incarnation we send Watch again for the first HeartbeatRsp (containing
the system UID) and if HeartbeatRsp contains a new system UID.
|
void |
rewatchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher) |
akka.actor.Scheduler |
scheduler() |
RemoteWatcher.HeartbeatRsp |
selfHeartbeatRspMsg() |
void |
sendHeartbeat() |
void |
terminated(akka.actor.ActorRef watchee,
boolean existenceConfirmed,
boolean addressTerminated) |
void |
triggerFirstHeartbeat(akka.actor.Address address) |
scala.collection.immutable.Set<akka.actor.Address> |
unreachable() |
void |
unwatchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher) |
scala.collection.immutable.Set<scala.Tuple2<akka.actor.ActorRef,akka.actor.ActorRef>> |
watching() |
scala.collection.immutable.Set<akka.actor.Address> |
watchingNodes() |
void |
watchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic RemoteWatcher(FailureDetectorRegistry<akka.actor.Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
public static akka.actor.Props props(FailureDetectorRegistry<akka.actor.Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
RemoteWatcher Props.failureDetector - (undocumented)heartbeatInterval - (undocumented)unreachableReaperInterval - (undocumented)heartbeatExpectedResponseAfter - (undocumented)public akka.actor.Scheduler scheduler()
public RemoteActorRefProvider remoteProvider()
public RemoteWatcher.HeartbeatRsp selfHeartbeatRspMsg()
public scala.collection.immutable.Set<scala.Tuple2<akka.actor.ActorRef,akka.actor.ActorRef>> watching()
public scala.collection.immutable.Set<akka.actor.Address> watchingNodes()
public scala.collection.immutable.Set<akka.actor.Address> unreachable()
public scala.collection.immutable.Map<akka.actor.Address,java.lang.Object> addressUids()
public akka.actor.Cancellable heartbeatTask()
public akka.actor.Cancellable failureDetectorReaperTask()
public void postStop()
postStop in interface akka.actor.Actorpublic scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
receive in interface akka.actor.Actorpublic void receiveHeartbeat()
public void receiveHeartbeatRsp(int uid)
public void reapUnreachable()
public void publishAddressTerminated(akka.actor.Address address)
public void quarantine(akka.actor.Address address,
scala.Option<java.lang.Object> uid)
public void rewatchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher)
public void watchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher)
public void addWatching(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher)
public void unwatchRemote(akka.actor.ActorRef watchee,
akka.actor.ActorRef watcher)
public void logActorForDeprecationWarning(akka.actor.ActorRef watchee)
public void terminated(akka.actor.ActorRef watchee,
boolean existenceConfirmed,
boolean addressTerminated)
public void checkLastUnwatchOfNode(akka.actor.Address watcheeAddress)
public void sendHeartbeat()
public void triggerFirstHeartbeat(akka.actor.Address address)
public void reWatch(akka.actor.Address address)
address - (undocumented)