public class FD_HOST extends Protocol
FD_ALL
and FD_SOCK
.
This protocol would typically be used when multiple cluster members are running on the same physical box.
JIRA: https://issues.jboss.org/browse/JGRP-1855Modifier and Type | Class and Description |
---|---|
static class |
FD_HOST.CommandExecutor |
static class |
FD_HOST.CommandExecutor2 |
protected static class |
FD_HOST.ExternalPingCommand |
static class |
FD_HOST.IsReachablePingCommand |
static interface |
FD_HOST.PingCommand
Command used to check whether a given host is alive, periodically called
|
protected class |
FD_HOST.PingTask
Selected members run this task periodically.
|
Modifier and Type | Field and Description |
---|---|
protected long |
check_timeout |
protected String |
cmd |
protected boolean |
has_suspected_mbrs |
protected Map<InetAddress,List<Address>> |
hosts
Map of hosts and their cluster members, updated on view changes.
|
protected long |
interval |
protected Address |
local_addr |
protected InetAddress |
local_host |
protected List<Address> |
members |
protected int |
num_liveness_checks |
protected int |
num_suspect_events |
protected FD_HOST.PingCommand |
ping_command
The command to detect whether a target is alive
|
protected Future<?> |
ping_task_future |
protected BoundedList<Tuple<InetAddress,Long>> |
suspect_history |
protected Set<Address> |
suspected_mbrs |
protected TimeService |
time_service |
protected long |
timeout |
protected TimeScheduler |
timer
Timer used to run the ping task on
|
protected ConcurrentMap<InetAddress,Long> |
timestamps |
protected boolean |
use_time_service |
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
FD_HOST() |
Modifier and Type | Method and Description |
---|---|
protected String |
_printTimestamps() |
Object |
down(Event evt)
An event is to be sent down the stack.
|
protected long |
getAgeOf(InetAddress host)
Returns the age (in secs) of the given host
|
protected InetAddress |
getHostFor(Address mbr) |
protected PhysicalAddress |
getPhysicalAddress(Address logical_addr) |
String |
getSuspectedMembers() |
protected long |
getTimestamp() |
protected void |
handleView(View view) |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isAlive(String host) |
protected boolean |
isPinger(Address mbr) |
boolean |
isPingerRunning() |
FD_HOST |
pingCommand(FD_HOST.PingCommand cmd) |
String |
printHosts() |
String |
printSuspectHistory() |
String |
printTimestamps() |
void |
resetStats() |
void |
setCommand(String command) |
protected void |
startPingerTask() |
void |
stop()
This method is called on a
Channel.disconnect() . |
protected void |
stopPingerTask() |
protected void |
suspect(InetAddress host)
Called by ping task; will result in all members of host getting suspected
|
protected void |
suspect(List<Address> suspects) |
protected boolean |
unsuspect(Address mbr) |
protected void |
updateTimestampFor(InetAddress host) |
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, up, up
protected String cmd
protected long timeout
protected long interval
protected long check_timeout
protected boolean use_time_service
protected int num_liveness_checks
protected int num_suspect_events
protected volatile boolean has_suspected_mbrs
protected final BoundedList<Tuple<InetAddress,Long>> suspect_history
protected Address local_addr
protected InetAddress local_host
protected FD_HOST.PingCommand ping_command
protected final Map<InetAddress,List<Address>> hosts
protected final ConcurrentMap<InetAddress,Long> timestamps
protected TimeScheduler timer
protected TimeService time_service
protected Future<?> ping_task_future
public FD_HOST pingCommand(FD_HOST.PingCommand cmd)
public void resetStats()
resetStats
in class Protocol
public void setCommand(String command)
public String printSuspectHistory()
public String printTimestamps()
public boolean isPingerRunning()
public String printHosts()
public String getSuspectedMembers()
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 flushedpublic 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()
.protected void handleView(View view)
protected PhysicalAddress getPhysicalAddress(Address logical_addr)
protected InetAddress getHostFor(Address mbr)
protected boolean isPinger(Address mbr)
protected void startPingerTask()
protected void stopPingerTask()
protected void suspect(InetAddress host)
protected boolean unsuspect(Address mbr)
protected String _printTimestamps()
protected void updateTimestampFor(InetAddress host)
protected long getAgeOf(InetAddress host)
protected long getTimestamp()
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.