Package org.jgroups.protocols
Class FD_ALL3
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.FailureDetection
org.jgroups.protocols.FD_ALL3
- All Implemented Interfaces:
Lifecycle
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.jgroups.protocols.FailureDetection
FailureDetection.HeartbeatHeader, FailureDetection.HeartbeatSender, FailureDetection.TimeoutChecker -
Field Summary
FieldsFields inherited from class org.jgroups.protocols.FailureDetection
HAS_HEADER, has_suspected_mbrs, heartbeat_sender, interval, lock, mcast_sent, members, num_heartbeats_received, num_heartbeats_sent, num_suspect_events, suspect_history, suspected_mbrs, timeout, timeout_checker, timerFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected intprotected Stringprotected longvoidinit()Called after a protocol has been created and before the protocol is started.protected <T> booleanneedsToBeSuspected(Address mbr, T value) setInterval(long i) setTimeout(long t) voidstart()This method is called on aJChannel.connect(String); starts work.protected voidMethods inherited from class org.jgroups.protocols.FailureDetection
createTimeoutChecker, down, down, getHeartbeatsReceived, getHeartbeatsSent, getInterval, getMembers, getSuspectedMembers, getSuspectEventsSent, getTimeout, handleViewChange, isHeartbeatSenderRunning, isRunning, isTimeoutCheckerRunning, printSuspectHistory, resetStats, retainKeys, startFailureDetection, startHeartbeatSender, startTimeoutChecker, stop, stopFailureDetection, stopHeartbeatSender, stopTimeoutChecker, suspect, unsuspect, up, upMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString, up
-
Field Details
-
timestamps
-
num_bits
protected int num_bits
-
-
Constructor Details
-
FD_ALL3
public FD_ALL3()
-
-
Method Details
-
getTimestamps
- Specified by:
getTimestampsin classFailureDetection
-
getTimeoutCheckInterval
protected long getTimeoutCheckInterval()- Specified by:
getTimeoutCheckIntervalin classFailureDetection
-
printTimestamps
-
init
Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.- Specified by:
initin interfaceLifecycle- Overrides:
initin classFailureDetection- Throws:
Exception- Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
-
start
Description copied from class:ProtocolThis method is called on aJChannel.connect(String); starts work. Protocols are connected ready to receive events. Will be called from bottom to top. -
setTimeout
- Overrides:
setTimeoutin classFailureDetection
-
setInterval
- Overrides:
setIntervalin classFailureDetection
-
update
- Specified by:
updatein classFailureDetection
-
computeBits
protected int computeBits() -
needsToBeSuspected
- Specified by:
needsToBeSuspectedin classFailureDetection
-
getTimeoutCheckerInfo
- Specified by:
getTimeoutCheckerInfoin classFailureDetection
-
_printTimestamps
-