public class PhiAccrualFailureDetector extends Object implements FailureDetector
Implementation of 'The Phi Accrual Failure Detector' by Hayashibara et al. as defined in their paper.
The suspicion level of failure is given by a value called φ (phi).
The basic idea of the φ failure detector is to express the value of φ on a scale that
is dynamically adjusted to reflect current network conditions. A configurable
threshold is used to decide if
φ is considered to be a failure.
The value of
φ is calculated as:
φ = -log10(1 - F(timeSinceLastHeartbeat)
|Constructor and Description|
|Modifier and Type||Method and Description|
Notifies this failure detector about received heartbeat message from the tracked member.
Returns true if the tracked member is considered as alive/available.
Returns the last heartbeat timestamp for the tracked member.
Returns suspicion level about the tracked member.
public PhiAccrualFailureDetector(double threshold, int maxSampleSize, double minStdDeviationMillis, long acceptableHeartbeatPauseMillis, long firstHeartbeatEstimateMillis)
threshold- A low threshold is prone to generate many wrong suspicions but ensures a quick detection in the event of a real crash. Conversely, a high threshold generates fewer mistakes but needs more time to detect actual crashes
maxSampleSize- Number of samples to use for calculation of mean and standard deviation of inter-arrival times.
minStdDeviationMillis- Minimum standard deviation to use for the normal distribution used when calculating phi. Too low standard deviation might result in too much sensitivity for sudden, but normal, deviations in heartbeat inter arrival times.
acceptableHeartbeatPauseMillis- Duration corresponding to number of potentially lost/delayed heartbeats that will be accepted before considering it to be an anomaly. This margin is important to be able to survive sudden, occasional, pauses in heartbeat arrivals, due to for example garbage collect or network drop.
firstHeartbeatEstimateMillis- Bootstrap the stats with heartbeats that corresponds to this duration, with a with rather high standard deviation (since environment is unknown in the beginning)
public boolean isAlive(long timestampMillis)
public void heartbeat(long timestampMillis)
public long lastHeartbeat()
public double suspicionLevel(long timestamp)
0indicates no suspicion at all.
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.