org.jgroups.protocols

Class FD


public class FD
extends Protocol

Failure detection based on simple heartbeat protocol. Regularly polls members for liveness. Multicasts SUSPECT messages when a member is not reachable. The simple algorithms works as follows: the membership is known and ordered. Each HB protocol periodically sends an 'are-you-alive' message to its *neighbor*. A neighbor is the next in rank in the membership list, which is recomputed upon a view change. When a response hasn't been received for n milliseconds and m tries, the corresponding member is suspected (and eventually excluded if faulty).

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.

When we receive a ping from a member that's not in the membership list, we shun it by sending it a NOT_MEMBER message. That member will then leave the group (and possibly rejoin). This is only done if shun is true.

Version:
$Revision: 1.31 $
Author:
Bela Ban

Nested Class Summary

static class
FD.FdHeader

Field Summary

Fields inherited from class org.jgroups.stack.Protocol

down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, trace, up_handler, up_prot, up_queue, up_thread, up_thread_prio, warn

Method Summary

void
down(Event evt)
int
getCurrentNumTries()
String
getLocalAddress()
int
getMaxTries()
String
getMembers()
String
getName()
int
getNumSuspectEventsGenerated()
int
getNumberOfHeartbeatsSent()
String
getPingDest()
String
getPingableMembers()
long
getTimeout()
void
init()
boolean
isShun()
String
printSuspectHistory()
void
resetStats()
void
setMaxTries(int max_tries)
boolean
setProperties(Properties props)
void
setShun(boolean flag)
void
setTimeout(long timeout)
void
stop()
void
up(Event evt)

Methods inherited from class org.jgroups.stack.Protocol

destroy, down, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getName, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setProperties, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, start, startDownHandler, startUpHandler, statsEnabled, stop, stopInternal, up, upThreadEnabled

Method Details

down

public void down(Event evt)
Overrides:
down in interface Protocol

getCurrentNumTries

public int getCurrentNumTries()

getLocalAddress

public String getLocalAddress()

getMaxTries

public int getMaxTries()

getMembers

public String getMembers()

getName

public String getName()
Overrides:
getName in interface Protocol

getNumSuspectEventsGenerated

public int getNumSuspectEventsGenerated()

getNumberOfHeartbeatsSent

public int getNumberOfHeartbeatsSent()

getPingDest

public String getPingDest()

getPingableMembers

public String getPingableMembers()

getTimeout

public long getTimeout()

init

public void init()
            throws Exception
Overrides:
init in interface Protocol

isShun

public boolean isShun()

printSuspectHistory

public String printSuspectHistory()

resetStats

public void resetStats()
Overrides:
resetStats in interface Protocol

setMaxTries

public void setMaxTries(int max_tries)

setProperties

public boolean setProperties(Properties props)
Overrides:
setProperties in interface Protocol

setShun

public void setShun(boolean flag)

setTimeout

public void setTimeout(long timeout)

stop

public void stop()
Overrides:
stop in interface Protocol

up

public void up(Event evt)
Overrides:
up in interface Protocol

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.