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-1855限定符和类型 | 类和说明 |
---|---|
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.
|
限定符和类型 | 字段和说明 |
---|---|
protected long |
check_timeout |
protected java.lang.String |
cmd |
protected boolean |
has_suspected_mbrs |
protected java.util.Map<java.net.InetAddress,java.util.List<Address>> |
hosts
Map of hosts and their cluster members, updated on view changes.
|
protected long |
interval |
protected Address |
local_addr |
protected java.net.InetAddress |
local_host |
protected java.util.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 java.util.concurrent.Future<?> |
ping_task_future |
protected BoundedList<Tuple<java.net.InetAddress,java.lang.Long>> |
suspect_history |
protected java.util.Set<Address> |
suspected_mbrs |
protected TimeService |
time_service |
protected long |
timeout |
protected TimeScheduler |
timer
Timer used to run the ping task on
|
protected java.util.concurrent.ConcurrentMap<java.net.InetAddress,java.lang.Long> |
timestamps |
protected boolean |
use_time_service |
构造器和说明 |
---|
FD_HOST() |
限定符和类型 | 方法和说明 |
---|---|
protected java.lang.String |
_printTimestamps() |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
protected long |
getAgeOf(java.net.InetAddress host)
Returns the age (in secs) of the given host
|
protected java.net.InetAddress |
getHostFor(Address mbr) |
protected PhysicalAddress |
getPhysicalAddress(Address logical_addr) |
java.lang.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(java.lang.String host) |
protected boolean |
isPinger(Address mbr) |
boolean |
isPingerRunning() |
FD_HOST |
pingCommand(FD_HOST.PingCommand cmd) |
java.lang.String |
printHosts() |
java.lang.String |
printSuspectHistory() |
java.lang.String |
printTimestamps() |
void |
resetStats() |
void |
setCommand(java.lang.String command) |
protected void |
startPingerTask() |
void |
stop()
This method is called on a
Channel.disconnect() . |
protected void |
stopPingerTask() |
protected void |
suspect(java.net.InetAddress host)
Called by ping task; will result in all members of host getting suspected
|
protected void |
suspect(java.util.List<Address> suspects) |
protected boolean |
unsuspect(Address mbr) |
protected void |
updateTimestampFor(java.net.InetAddress host) |
accept, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, 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 java.lang.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 final java.util.Set<Address> suspected_mbrs
protected volatile boolean has_suspected_mbrs
protected final BoundedList<Tuple<java.net.InetAddress,java.lang.Long>> suspect_history
protected Address local_addr
protected java.net.InetAddress local_host
protected final java.util.List<Address> members
protected FD_HOST.PingCommand ping_command
protected final java.util.Map<java.net.InetAddress,java.util.List<Address>> hosts
protected final java.util.concurrent.ConcurrentMap<java.net.InetAddress,java.lang.Long> timestamps
protected TimeScheduler timer
protected TimeService time_service
protected java.util.concurrent.Future<?> ping_task_future
public FD_HOST pingCommand(FD_HOST.PingCommand cmd)
public void resetStats()
resetStats
在类中 Protocol
public void setCommand(java.lang.String command)
public java.lang.String printSuspectHistory()
public java.lang.String printTimestamps()
public boolean isPingerRunning()
public java.lang.String printHosts()
public boolean isAlive(java.lang.String host) throws java.lang.Exception
java.lang.Exception
public java.lang.String getSuspectedMembers()
public void init() throws java.lang.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 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()
.protected void handleView(View view)
protected PhysicalAddress getPhysicalAddress(Address logical_addr)
protected java.net.InetAddress getHostFor(Address mbr)
protected boolean isPinger(Address mbr)
protected void startPingerTask()
protected void stopPingerTask()
protected void suspect(java.net.InetAddress host)
protected void suspect(java.util.List<Address> suspects)
protected boolean unsuspect(Address mbr)
protected java.lang.String _printTimestamps()
protected void updateTimestampFor(java.net.InetAddress host)
protected long getAgeOf(java.net.InetAddress host)
protected long getTimestamp()