|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.remote.RemoteWatcher
public class RemoteWatcher
INTERNAL API
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.
Nested Class Summary | |
---|---|
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$
|
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Constructor Summary | |
---|---|
RemoteWatcher(FailureDetectorRegistry<Address> failureDetector,
scala.concurrent.duration.FiniteDuration heartbeatInterval,
scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
|
Method Summary | |
---|---|
scala.collection.immutable.Map<Address,java.lang.Object> |
addressUids()
|
void |
addWatching(ActorRef watchee,
ActorRef watcher)
|
void |
checkLastUnwatchOfNode(Address watcheeAddress)
|
Cancellable |
failureDetectorReaperTask()
|
Cancellable |
heartbeatTask()
|
void |
logActorForDeprecationWarning(ActorRef watchee)
|
void |
postStop()
User overridable callback. |
static Props |
props(FailureDetectorRegistry<Address> failureDetector,
scala.concurrent.duration.FiniteDuration heartbeatInterval,
scala.concurrent.duration.FiniteDuration unreachableReaperInterval,
scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
Factory method for RemoteWatcher Props . |
void |
publishAddressTerminated(Address address)
|
void |
quarantine(Address address,
scala.Option<java.lang.Object> uid)
|
void |
reapUnreachable()
|
scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> |
receive()
This defines the initial actor behavior, it must return a partial function with the actor logic. |
void |
receiveHeartbeat()
|
void |
receiveHeartbeatRsp(int uid)
|
RemoteActorRefProvider |
remoteProvider()
|
void |
reWatch(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(ActorRef watchee,
ActorRef watcher)
|
Scheduler |
scheduler()
|
RemoteWatcher.HeartbeatRsp |
selfHeartbeatRspMsg()
|
void |
sendHeartbeat()
|
void |
terminated(ActorRef watchee,
boolean existenceConfirmed,
boolean addressTerminated)
|
void |
triggerFirstHeartbeat(Address address)
|
scala.collection.immutable.Set<Address> |
unreachable()
|
void |
unwatchRemote(ActorRef watchee,
ActorRef watcher)
|
scala.collection.immutable.Set<scala.Tuple2<ActorRef,ActorRef>> |
watching()
|
scala.collection.immutable.Set<Address> |
watchingNodes()
|
void |
watchRemote(ActorRef watchee,
ActorRef watcher)
|
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 |
---|
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, postRestart, preRestart, preStart, self, sender, supervisorStrategy, unhandled |
Methods inherited from interface akka.actor.ActorLogging |
---|
_log, log |
Constructor Detail |
---|
public RemoteWatcher(FailureDetectorRegistry<Address> failureDetector, scala.concurrent.duration.FiniteDuration heartbeatInterval, scala.concurrent.duration.FiniteDuration unreachableReaperInterval, scala.concurrent.duration.FiniteDuration heartbeatExpectedResponseAfter)
Method Detail |
---|
public static Props props(FailureDetectorRegistry<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 Scheduler scheduler()
public RemoteActorRefProvider remoteProvider()
public RemoteWatcher.HeartbeatRsp selfHeartbeatRspMsg()
public scala.collection.immutable.Set<scala.Tuple2<ActorRef,ActorRef>> watching()
public scala.collection.immutable.Set<Address> watchingNodes()
public scala.collection.immutable.Set<Address> unreachable()
public scala.collection.immutable.Map<Address,java.lang.Object> addressUids()
public Cancellable heartbeatTask()
public Cancellable failureDetectorReaperTask()
public void postStop()
Actor
postStop
in interface Actor
public scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive()
Actor
receive
in interface Actor
public void receiveHeartbeat()
public void receiveHeartbeatRsp(int uid)
public void reapUnreachable()
public void publishAddressTerminated(Address address)
public void quarantine(Address address, scala.Option<java.lang.Object> uid)
public void rewatchRemote(ActorRef watchee, ActorRef watcher)
public void watchRemote(ActorRef watchee, ActorRef watcher)
public void addWatching(ActorRef watchee, ActorRef watcher)
public void unwatchRemote(ActorRef watchee, ActorRef watcher)
public void logActorForDeprecationWarning(ActorRef watchee)
public void terminated(ActorRef watchee, boolean existenceConfirmed, boolean addressTerminated)
public void checkLastUnwatchOfNode(Address watcheeAddress)
public void sendHeartbeat()
public void triggerFirstHeartbeat(Address address)
public void reWatch(Address address)
address
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |