Package org.apache.cassandra.gms
Class FailureDetector
java.lang.Object
org.apache.cassandra.gms.FailureDetector
- All Implemented Interfaces:
FailureDetectorMBean,IFailureDetector
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longstatic final IFailureDetectorstatic final Predicate<InetAddressAndPort>static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDump the inter arrival times for examination if necessary.voidforce conviction of endpoint in the failure detectorgetAllEndpointStates(boolean withPort) getAllEndpointStates(boolean withPort, boolean resolveIp) intgetEndpointState(String address) doubleintvoidThis method is invoked by any entity wanting to interrogate the status of an endpoint.booleanFailure Detector's knowledge of whether a node is up or down.voidRegister interest for Failure Detector events.voidremove endpoint from failure detectorvoidThis method is invoked by the receiver of the heartbeat.voidsetPhiConvictThreshold(double phi) toString()voidUn-register interest for Failure Detector events.
-
Field Details
-
MBEAN_NAME
- See Also:
-
INITIAL_VALUE_NANOS
protected static final long INITIAL_VALUE_NANOS -
instance
-
isEndpointAlive
-
isReplicaAlive
-
-
Constructor Details
-
FailureDetector
public FailureDetector()
-
-
Method Details
-
getAllEndpointStates
- Specified by:
getAllEndpointStatesin interfaceFailureDetectorMBean
-
getAllEndpointStatesWithResolveIp
- Specified by:
getAllEndpointStatesWithResolveIpin interfaceFailureDetectorMBean
-
getAllEndpointStatesWithPort
- Specified by:
getAllEndpointStatesWithPortin interfaceFailureDetectorMBean
-
getAllEndpointStatesWithPortAndResolveIp
- Specified by:
getAllEndpointStatesWithPortAndResolveIpin interfaceFailureDetectorMBean
-
getAllEndpointStates
-
getAllEndpointStates
-
getSimpleStates
- Specified by:
getSimpleStatesin interfaceFailureDetectorMBean
-
getSimpleStatesWithPort
- Specified by:
getSimpleStatesWithPortin interfaceFailureDetectorMBean
-
getDownEndpointCount
public int getDownEndpointCount()- Specified by:
getDownEndpointCountin interfaceFailureDetectorMBean
-
getUpEndpointCount
public int getUpEndpointCount()- Specified by:
getUpEndpointCountin interfaceFailureDetectorMBean
-
getPhiValues
- Specified by:
getPhiValuesin interfaceFailureDetectorMBean- Throws:
OpenDataException
-
getPhiValuesWithPort
- Specified by:
getPhiValuesWithPortin interfaceFailureDetectorMBean- Throws:
OpenDataException
-
getEndpointState
- Specified by:
getEndpointStatein interfaceFailureDetectorMBean- Throws:
UnknownHostException
-
dumpInterArrivalTimes
public void dumpInterArrivalTimes()Dump the inter arrival times for examination if necessary.- Specified by:
dumpInterArrivalTimesin interfaceFailureDetectorMBean
-
setPhiConvictThreshold
public void setPhiConvictThreshold(double phi) - Specified by:
setPhiConvictThresholdin interfaceFailureDetectorMBean
-
getPhiConvictThreshold
public double getPhiConvictThreshold()- Specified by:
getPhiConvictThresholdin interfaceFailureDetectorMBean
-
isAlive
Description copied from interface:IFailureDetectorFailure Detector's knowledge of whether a node is up or down.- Specified by:
isAlivein interfaceIFailureDetector- Parameters:
ep- endpoint in question.- Returns:
- true if UP and false if DOWN.
-
report
Description copied from interface:IFailureDetectorThis 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:
reportin interfaceIFailureDetector
-
interpret
Description copied from interface:IFailureDetectorThis 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:
interpretin interfaceIFailureDetector
-
forceConviction
Description copied from interface:IFailureDetectorforce conviction of endpoint in the failure detector- Specified by:
forceConvictionin interfaceIFailureDetector
-
remove
Description copied from interface:IFailureDetectorremove endpoint from failure detector- Specified by:
removein interfaceIFailureDetector
-
registerFailureDetectionEventListener
Description copied from interface:IFailureDetectorRegister interest for Failure Detector events.- Specified by:
registerFailureDetectionEventListenerin interfaceIFailureDetector- Parameters:
listener- implementation of an application provided IFailureDetectionEventListener
-
unregisterFailureDetectionEventListener
Description copied from interface:IFailureDetectorUn-register interest for Failure Detector events.- Specified by:
unregisterFailureDetectionEventListenerin interfaceIFailureDetector- Parameters:
listener- implementation of an application provided IFailureDetectionEventListener
-
toString
-