Package org.jgroups.protocols
Class FD_ALL
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.FailureDetection
-
- org.jgroups.protocols.FD_ALL
-
public class FD_ALL extends FailureDetection
Failure detection based on simple heartbeat protocol. Every member periodically multicasts a heartbeat. Every member also maintains a table of all members (minus itself). When data or a heartbeat from P is received, we reset the timestamp for P to the current time. Periodically, we check for expired members, and suspect those. Reduced number of messages exchanged on suspect event: https://jira.jboss.org/browse/JGRP-1241- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.FailureDetection
FailureDetection.HeartbeatHeader
-
-
Field Summary
Fields Modifier and Type Field Description protected TimeServicetime_serviceprotected longtimeout_check_intervalprotected java.util.concurrent.ConcurrentMap<Address,java.lang.Long>timestampsprotected booleanuse_time_service-
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_ALL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String_printTimestamps()protected java.lang.StringgetTimeoutCheckerInfo()longgetTimeoutCheckInterval()protected longgetTimestamp()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()<T extends FailureDetection>
TsetTimeoutCheckInterval(long i)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
-
timeout_check_interval
protected long timeout_check_interval
-
use_time_service
protected boolean use_time_service
-
timestamps
protected final java.util.concurrent.ConcurrentMap<Address,java.lang.Long> timestamps
-
time_service
protected TimeService time_service
-
-
Method Detail
-
getTimestamps
protected java.util.Map<Address,?> getTimestamps()
- Specified by:
getTimestampsin classFailureDetection
-
getTimeoutCheckInterval
public long getTimeoutCheckInterval()
- Specified by:
getTimeoutCheckIntervalin classFailureDetection
-
setTimeoutCheckInterval
public <T extends FailureDetection> T setTimeoutCheckInterval(long i)
-
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
-
getTimestamp
protected long getTimestamp()
-
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()
-
-