public class FD extends Protocol
FD starts when it detects (in a view change notification) that there are at least 2 members in the group. It stops running when the membership drops below 2.
When a message is received from the monitored neighbor member, it causes the pinger thread to 'skip' sending the next are-you-alive message. Thus, traffic is reduced.
Modifier and Type | Class and Description |
---|---|
protected class |
FD.Broadcaster
Task that periodically broadcasts a list of suspected members to the group.
|
protected class |
FD.BroadcastTask |
static class |
FD.FdHeader |
protected class |
FD.Monitor |
Modifier and Type | Field and Description |
---|---|
protected FD.Broadcaster |
bcast_task
Transmits SUSPECT message until view change or UNSUSPECT is received
|
protected Address |
local_addr |
protected Lock |
lock |
protected List<Address> |
members |
protected int |
num_heartbeats |
protected int |
num_suspect_events |
protected int |
num_tries |
protected Address |
ping_dest |
protected List<Address> |
pingable_mbrs
Members from which we select ping_dest.
|
protected BoundedList<Address> |
suspect_history |
Constructor and Description |
---|
FD() |
Modifier and Type | Method and Description |
---|---|
protected FD.Monitor |
createMonitor() |
Object |
down(Event evt)
An event is to be sent down the stack.
|
int |
getCurrentNumTries() |
String |
getLocalAddress() |
int |
getMaxTries() |
String |
getMembers() |
int |
getNumberOfHeartbeatsSent() |
int |
getNumSuspectEventsGenerated() |
String |
getPingableMembers() |
String |
getPingDest() |
long |
getTimeout() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isMonitorRunning() |
String |
printSuspectHistory() |
void |
resetStats() |
void |
setMaxTries(int max_tries) |
void |
setTimeout(long timeout) |
void |
startFailureDetection() |
void |
stop()
This method is called on a
Channel.disconnect() . |
void |
stopFailureDetection() |
Object |
up(Event evt)
An event was received from the layer below.
|
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled
protected int num_heartbeats
protected int num_suspect_events
protected final BoundedList<Address> suspect_history
protected Address local_addr
protected int num_tries
protected final Lock lock
protected Address ping_dest
protected final List<Address> pingable_mbrs
members
protected final FD.Broadcaster bcast_task
public String getLocalAddress()
public String getMembers()
public String getPingableMembers()
public String getPingDest()
public int getNumberOfHeartbeatsSent()
public int getNumSuspectEventsGenerated()
public long getTimeout()
public void setTimeout(long timeout)
public int getMaxTries()
public void setMaxTries(int max_tries)
public int getCurrentNumTries()
public String printSuspectHistory()
public void resetStats()
resetStats
in class Protocol
public void init() throws Exception
Protocol
public void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedprotected FD.Monitor createMonitor()
public void stopFailureDetection()
public void startFailureDetection()
public boolean isMonitorRunning()
public Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.public Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.