org.apache.cassandra.gms
Class FailureDetector

java.lang.Object
  extended by org.apache.cassandra.gms.FailureDetector
All Implemented Interfaces:
FailureDetectorMBean, IFailureDetector

public class FailureDetector
extends java.lang.Object
implements IFailureDetector, FailureDetectorMBean

This FailureDetector is an implementation of the paper titled "The Phi Accrual Failure Detector" by Hayashibara. Check the paper and the IFailureDetector interface for details. Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


Constructor Summary
FailureDetector()
           
 
Method Summary
 void dumpInterArrivalTimes()
          Dump the inter arrival times for examination if necessary.
static IFailureDetector instance()
           
 void intepret(EndPoint ep)
          This method is invoked by any entity wanting to interrogate the status of an endpoint.
 boolean isAlive(EndPoint ep)
          Failure Detector's knowledge of whether a node is up or down.
static void main(java.lang.String[] args)
           
 void registerFailureDetectionEventListener(IFailureDetectionEventListener listener)
          Register interest for Failure Detector events.
 void report(EndPoint ep)
          This method is invoked by the receiver of the heartbeat.
 java.lang.String toString()
           
 void unregisterFailureDetectionEventListener(IFailureDetectionEventListener listener)
          Un-register interest for Failure Detector events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FailureDetector

public FailureDetector()
Method Detail

instance

public static IFailureDetector instance()

dumpInterArrivalTimes

public void dumpInterArrivalTimes()
Dump the inter arrival times for examination if necessary.

Specified by:
dumpInterArrivalTimes in interface FailureDetectorMBean

isAlive

public boolean isAlive(EndPoint ep)
Description copied from interface: IFailureDetector
Failure Detector's knowledge of whether a node is up or down.

Specified by:
isAlive in interface IFailureDetector
Parameters:
ep - endpoint in question.
Returns:
true if UP and false if DOWN.

report

public void report(EndPoint ep)
Description copied from interface: IFailureDetector
This method is invoked by the receiver of the heartbeat. In our case it would be the Gossiper. Gossiper inform the Failure Detector on receipt of a heartbeat. The FailureDetector will then sample the arrival time as explained in the paper. param ep endpoint being reported.

Specified by:
report in interface IFailureDetector

intepret

public void intepret(EndPoint ep)
Description copied from interface: IFailureDetector
This method is invoked by any entity wanting to interrogate the status of an endpoint. In our case it would be the Gossiper. The Failure Detector will then calculate Phi and deem an endpoint as suspicious or alive as explained in the Hayashibara paper. param ep endpoint for which we interpret the inter arrival times.

Specified by:
intepret in interface IFailureDetector

registerFailureDetectionEventListener

public void registerFailureDetectionEventListener(IFailureDetectionEventListener listener)
Description copied from interface: IFailureDetector
Register interest for Failure Detector events.

Specified by:
registerFailureDetectionEventListener in interface IFailureDetector
Parameters:
listener - implementation of an application provided IFailureDetectionEventListener

unregisterFailureDetectionEventListener

public void unregisterFailureDetectionEventListener(IFailureDetectionEventListener listener)
Description copied from interface: IFailureDetector
Un-register interest for Failure Detector events.

Specified by:
unregisterFailureDetectionEventListener in interface IFailureDetector
Parameters:
listener - implementation of an application provided IFailureDetectionEventListener

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Throws:
java.lang.Throwable


Copyright © 2009 The Apache Software Foundation