|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.protocols.FD_ALL
public class FD_ALL
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
Nested Class Summary | |
---|---|
static class |
FD_ALL.HeartbeatHeader
|
Field Summary | |
---|---|
protected int |
num_heartbeats_received
|
protected int |
num_heartbeats_sent
|
protected int |
num_suspect_events
|
protected java.util.Set<Address> |
suspected_mbrs
|
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_prot, ergonomics, id, log, name, stack, stats, up_prot |
Constructor Summary | |
---|---|
FD_ALL()
|
Method Summary | |
---|---|
java.lang.Object |
down(Event evt)
An event is to be sent down the stack. |
int |
getHeartbeatsReceived()
|
int |
getHeartbeatsSent()
|
long |
getInterval()
|
java.lang.String |
getLocalAddress()
|
java.lang.String |
getMembers()
|
java.lang.String |
getSuspectedMembers()
|
int |
getSuspectEventsSent()
|
long |
getTimeout()
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
boolean |
isRunning()
|
static boolean |
isShun()
Deprecated. |
java.lang.String |
printSuspectHistory()
|
java.lang.String |
printTimestamps()
|
void |
resetStats()
|
void |
setInterval(long interval)
|
void |
setShun(boolean flag)
Deprecated. |
void |
setTimeout(long timeout)
|
void |
startFailureDetection()
|
void |
stop()
This method is called on a Channel.disconnect() . |
void |
stopFailureDetection()
|
java.lang.Object |
up(Event evt)
An event was received from the layer below. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int num_heartbeats_sent
protected int num_heartbeats_received
protected int num_suspect_events
protected final java.util.Set<Address> suspected_mbrs
Constructor Detail |
---|
public FD_ALL()
Method Detail |
---|
public java.lang.String getLocalAddress()
public java.lang.String getMembers()
public java.lang.String getSuspectedMembers()
public int getHeartbeatsSent()
public int getHeartbeatsReceived()
public int getSuspectEventsSent()
public long getTimeout()
public void setTimeout(long timeout)
public long getInterval()
public void setInterval(long interval)
@Deprecated public static boolean isShun()
@Deprecated public void setShun(boolean flag)
public boolean isRunning()
public java.lang.String printSuspectHistory()
public java.lang.String printTimestamps()
public void stopFailureDetection()
public void startFailureDetection()
public void resetStats()
resetStats
in class Protocol
public void init() throws java.lang.Exception
Protocol
init
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic 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 flushed
stop
in class Protocol
public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.
up
in class Protocol
public java.lang.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()
.
down
in class Protocol
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |