Package org.jgroups.protocols
Class FD_ALL
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.FailureDetection
-
- org.jgroups.protocols.FD_ALL
-
- All Implemented Interfaces:
Lifecycle
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://issues.redhat.com/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 TimeService
time_service
protected long
timeout_check_interval
protected java.util.concurrent.ConcurrentMap<Address,java.lang.Long>
timestamps
protected boolean
use_time_service
-
Fields 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, timer
-
Fields 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 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.String
getTimeoutCheckerInfo()
long
getTimeoutCheckInterval()
protected long
getTimestamp()
protected java.util.Map<Address,?>
getTimestamps()
void
init()
Called after a protocol has been created and before the protocol is started.protected <T> boolean
needsToBeSuspected(Address mbr, T value)
java.lang.String
printTimestamps()
<T extends FailureDetection>
TsetTimeoutCheckInterval(long i)
protected void
update(Address sender, boolean log_msg, boolean skip_if_exists)
-
Methods inherited from class org.jgroups.protocols.FailureDetection
createTimeoutChecker, down, down, getHeartbeatsReceived, getHeartbeatsSent, getInterval, 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, 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, start, statsEnabled, toString, 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:
getTimestamps
in classFailureDetection
-
getTimeoutCheckInterval
public long getTimeoutCheckInterval()
- Specified by:
getTimeoutCheckInterval
in classFailureDetection
-
setTimeoutCheckInterval
public <T extends FailureDetection> T setTimeoutCheckInterval(long i)
-
printTimestamps
public java.lang.String printTimestamps()
-
init
public void init() throws java.lang.Exception
Description copied from class:Protocol
Called 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:
init
in interfaceLifecycle
- Overrides:
init
in classFailureDetection
- Throws:
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
-
update
protected void update(Address sender, boolean log_msg, boolean skip_if_exists)
- Specified by:
update
in classFailureDetection
-
getTimestamp
protected long getTimestamp()
-
needsToBeSuspected
protected <T> boolean needsToBeSuspected(Address mbr, T value)
- Specified by:
needsToBeSuspected
in classFailureDetection
-
getTimeoutCheckerInfo
protected java.lang.String getTimeoutCheckerInfo()
- Specified by:
getTimeoutCheckerInfo
in classFailureDetection
-
_printTimestamps
protected java.lang.String _printTimestamps()
-
-