public class DeadlineFailureDetector extends java.lang.Object implements FailureDetector
isAvailable()
will return false
if there is no heartbeat()
within the duration
heartbeatInterval + 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).
FailureDetector.Clock
Constructor and Description |
---|
DeadlineFailureDetector(com.typesafe.config.Config config,
EventStream ev)
Constructor that reads parameters from config.
|
DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause,
FailureDetector.Clock clock)
Deprecated.
Use constructor with acceptableHeartbeatPause and heartbeatInterval. Since 2.4.
|
DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause,
scala.concurrent.duration.FiniteDuration heartbeatInterval,
FailureDetector.Clock clock) |
Modifier and Type | Method and 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.
|
public DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause, scala.concurrent.duration.FiniteDuration heartbeatInterval, FailureDetector.Clock clock)
public DeadlineFailureDetector(com.typesafe.config.Config config, EventStream ev)
acceptable-heartbeat-pause
.config
- (undocumented)ev
- (undocumented)public DeadlineFailureDetector(scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause, FailureDetector.Clock clock)
public scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause()
public scala.concurrent.duration.FiniteDuration heartbeatInterval()
public boolean isAvailable()
FailureDetector
isAvailable
in interface FailureDetector
public boolean isMonitoring()
FailureDetector
isMonitoring
in interface FailureDetector
public final void heartbeat()
FailureDetector
heartbeat
in interface FailureDetector