akka.remote
Class PhiAccrualFailureDetector

java.lang.Object
  extended by akka.remote.PhiAccrualFailureDetector
All Implemented Interfaces:
FailureDetector

public class PhiAccrualFailureDetector
extends java.lang.Object
implements FailureDetector

Implementation of 'The Phi Accrual Failure Detector' by Hayashibara et al. as defined in their paper: [http://ddg.jaist.ac.jp/pub/HDY+04.pdf]

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)
 
where F is the cumulative distribution function of a normal distribution with mean and standard deviation estimated from historical heartbeat inter-arrival times.


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.remote.FailureDetector
FailureDetector.Clock
 
Constructor Summary
PhiAccrualFailureDetector(com.typesafe.config.Config config, EventStream ev)
          Constructor that reads parameters from config.
PhiAccrualFailureDetector(double threshold, int maxSampleSize, scala.concurrent.duration.FiniteDuration minStdDeviation, scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause, scala.concurrent.duration.FiniteDuration firstHeartbeatEstimate, FailureDetector.Clock clock)
           
 
Method Summary
 scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause()
           
 scala.concurrent.duration.FiniteDuration firstHeartbeatEstimate()
           
 void heartbeat()
          Notifies the FailureDetector that a heartbeat arrived from the monitored resource.
 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.
 int maxSampleSize()
           
 scala.concurrent.duration.FiniteDuration minStdDeviation()
           
 double phi()
          The suspicion level of the accrual failure detector.
 double threshold()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.remote.FailureDetector
defaultClock
 

Constructor Detail

PhiAccrualFailureDetector

public PhiAccrualFailureDetector(double threshold,
                                 int maxSampleSize,
                                 scala.concurrent.duration.FiniteDuration minStdDeviation,
                                 scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause,
                                 scala.concurrent.duration.FiniteDuration firstHeartbeatEstimate,
                                 FailureDetector.Clock clock)

PhiAccrualFailureDetector

public PhiAccrualFailureDetector(com.typesafe.config.Config config,
                                 EventStream ev)
Constructor that reads parameters from config. Expecting config properties named threshold, max-sample-size, min-std-deviation, acceptable-heartbeat-pause and heartbeat-interval.

Method Detail

threshold

public double threshold()

maxSampleSize

public int maxSampleSize()

minStdDeviation

public scala.concurrent.duration.FiniteDuration minStdDeviation()

acceptableHeartbeatPause

public scala.concurrent.duration.FiniteDuration acceptableHeartbeatPause()

firstHeartbeatEstimate

public scala.concurrent.duration.FiniteDuration firstHeartbeatEstimate()

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 interface FailureDetector

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 interface FailureDetector

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 interface FailureDetector

phi

public double phi()
The suspicion level of the accrual failure detector.

If a connection does not have any records in failure detector then it is considered healthy.