Package org.jgroups.protocols
Class FD_ALL3
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.FailureDetection
-
- org.jgroups.protocols.FD_ALL3
-
public class FD_ALL3 extends FailureDetection
Failure detection based on simple heartbeat protocol. Every member periodically (interval ms) multicasts a heartbeat. Every member maintains a table of all members (minus itself) and a bitmap with timeout/interval bits, initially all set to 1. On each interval, the TimeoutChecker task advances the index and sets the bit at the index to 0.
When all bits are 0, a member will be suspected.
On reception of a message or heartbeat from P, P's bitmap at index is set to 1.
JIRA: https://issues.redhat.com/browse/JGRP-2451- Version:
- 5.0.0
- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFD_ALL3.Bitmap-
Nested classes/interfaces inherited from class org.jgroups.protocols.FailureDetection
FailureDetection.HeartbeatHeader
-
-
Field Summary
Fields Modifier and Type Field Description protected intnum_bitsprotected java.util.Map<Address,FD_ALL3.Bitmap>timestamps-
Fields inherited from class org.jgroups.protocols.FailureDetection
HAS_HEADER, has_suspected_mbrs, heartbeat_sender, interval, local_addr, lock, mcast_sent, members, num_heartbeats_received, num_heartbeats_sent, num_suspect_events, suspect_history, suspected_mbrs, timeout, timeout_checker, timer
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, log, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description FD_ALL3()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String_printTimestamps()protected java.lang.StringgetTimeoutCheckerInfo()protected longgetTimeoutCheckInterval()protected java.util.Map<Address,?>getTimestamps()voidinit()Called after instance has been created (null constructor) and before protocol is started.protected <T> booleanneedsToBeSuspected(Address mbr, T value)java.lang.StringprintTimestamps()protected voidupdate(Address sender, boolean log_msg, boolean skip_if_exists)-
Methods inherited from class org.jgroups.protocols.FailureDetection
createTimeoutChecker, down, down, getHeartbeatsReceived, getHeartbeatsSent, getInterval, getLocalAddress, getMembers, getSuspectedMembers, getSuspectEventsSent, getTimeout, handleViewChange, isHeartbeatSenderRunning, isRunning, isTimeoutCheckerRunning, printSuspectHistory, resetStats, retainKeys, setInterval, setTimeout, startFailureDetection, startHeartbeatSender, startTimeoutChecker, stop, stopFailureDetection, stopHeartbeatSender, stopTimeoutChecker, suspect, unsuspect, up, up
-
Methods inherited from class org.jgroups.stack.Protocol
accept, afterCreationHook, destroy, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, up
-
-
-
-
Field Detail
-
timestamps
protected final java.util.Map<Address,FD_ALL3.Bitmap> timestamps
-
num_bits
protected int num_bits
-
-
Method Detail
-
getTimestamps
protected java.util.Map<Address,?> getTimestamps()
- Specified by:
getTimestampsin classFailureDetection
-
getTimeoutCheckInterval
protected long getTimeoutCheckInterval()
- Specified by:
getTimeoutCheckIntervalin classFailureDetection
-
printTimestamps
public java.lang.String printTimestamps()
-
init
public void init() throws java.lang.ExceptionDescription copied from class:ProtocolCalled after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent.- Overrides:
initin classFailureDetection- Throws:
java.lang.Exception- Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the channel constructor will throw an exception
-
update
protected void update(Address sender, boolean log_msg, boolean skip_if_exists)
- Specified by:
updatein classFailureDetection
-
needsToBeSuspected
protected <T> boolean needsToBeSuspected(Address mbr, T value)
- Specified by:
needsToBeSuspectedin classFailureDetection
-
getTimeoutCheckerInfo
protected java.lang.String getTimeoutCheckerInfo()
- Specified by:
getTimeoutCheckerInfoin classFailureDetection
-
_printTimestamps
protected java.lang.String _printTimestamps()
-
-