Package akka.remote
Class DeadlineFailureDetector
- java.lang.Object
-
- akka.remote.DeadlineFailureDetector
-
- All Implemented Interfaces:
FailureDetector
public class DeadlineFailureDetector extends java.lang.Object implements FailureDetector
Implementation of failure detector using an absolute timeout of missing heartbeats to trigger unavailability.isAvailable()
will returnfalse
if there is noheartbeat()
within the durationheartbeatInterval + acceptableHeartbeatPause
.param: acceptableHeartbeatPause Duration corresponding to number of potentially lost/delayed heartbeats that will be accepted before considering it to be an anomaly.
param: heartbeatInterval Expected heartbeat interval
param: clock The clock, returning current time in milliseconds, but can be faked for testing purposes. It is only used for measuring intervals (duration).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface akka.remote.FailureDetector
FailureDetector.Clock
-
-
Constructor Summary
Constructors Constructor Description DeadlineFailureDetector(com.typesafe.config.Config config, EventStream ev)
Constructor that reads parameters from config.DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause, scala.concurrent.duration.FiniteDuration heartbeatInterval, FailureDetector.Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.concurrent.duration.FiniteDuration
acceptableHeartbeatPause()
void
heartbeat()
Notifies the FailureDetector that a heartbeat arrived from the monitored resource.scala.concurrent.duration.FiniteDuration
heartbeatInterval()
boolean
isAvailable()
Returns true if the resource is considered to be up and healthy and returns false otherwise.boolean
isMonitoring()
Returns true if the failure detector has received any heartbeats and started monitoring of the resource.
-
-
-
Constructor Detail
-
DeadlineFailureDetector
public DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause, scala.concurrent.duration.FiniteDuration heartbeatInterval, FailureDetector.Clock clock)
-
DeadlineFailureDetector
public DeadlineFailureDetector(com.typesafe.config.Config config, EventStream ev)
Constructor that reads parameters from config. Expecting config properties namedacceptable-heartbeat-pause
.
-
-
Method Detail
-
acceptableHeartbeatPause
public scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause()
-
heartbeat
public final void heartbeat()
Description copied from interface:FailureDetector
Notifies the FailureDetector that a heartbeat arrived from the monitored resource. This causes the FailureDetector to update its state.- Specified by:
heartbeat
in interfaceFailureDetector
-
heartbeatInterval
public scala.concurrent.duration.FiniteDuration heartbeatInterval()
-
isAvailable
public boolean isAvailable()
Description copied from interface:FailureDetector
Returns true if the resource is considered to be up and healthy and returns false otherwise.- Specified by:
isAvailable
in interfaceFailureDetector
-
isMonitoring
public boolean isMonitoring()
Description copied from interface:FailureDetector
Returns true if the failure detector has received any heartbeats and started monitoring of the resource.- Specified by:
isMonitoring
in interfaceFailureDetector
-
-