public class TCPGOSSIP extends Discovery
The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack.
always_send_physical_addr_with_discovery_request, async_discovery, break_on_coord_rsp, cluster_name, current_coord, discovery_rsp_expiry_time, force_sending_discovery_rsps, is_coord, is_leaving, is_server, local_addr, max_members_in_discovery_request, members, num_discovery_requests, num_initial_members, num_initial_srv_members, ping_responses, return_entire_cache, stagger_timeout, timeout, timer, transport_supports_multicasting, use_disk_cache, view, WHITESPACE
构造器和说明 |
---|
TCPGOSSIP() |
限定符和类型 | 方法和说明 |
---|---|
void |
addInitialHost(java.lang.String hostname,
int port) |
protected void |
connect(RouterStub stub,
java.lang.String group,
Address logical_addr) |
protected void |
connectAllStubs(java.lang.String group,
Address logical_addr) |
void |
destroy()
This method is called on a
Channel.close() . |
void |
findMembers(java.util.List<Address> members,
boolean initial_discovery,
Responses responses)
Fetches information (e.g. physical address, logical name) for the given member addresses.
|
java.util.List<java.net.InetSocketAddress> |
getInitialHosts() |
void |
handleConnect() |
void |
handleDisconnect() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isDynamic() |
boolean |
removeInitialHost(java.lang.String hostname,
int port) |
void |
setInitialHosts(java.util.List<java.net.InetSocketAddress> hosts) |
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
addDiscoveryResponseToCaches, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, deserialize, discoveryRequestReceived, down, dumpCache, findInitialMembersAsString, findMembers, forceDiscoveryResponses, forceDiscoveryResponses, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getTimeout, getView, getViewId, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, numInitialMembers, numInitialMembers, providedUpServices, read, readPingData, resetStats, returnEntireCache, returnEntireCache, sendDiscoveryResponse, serializeWithoutView, setForceSendingDiscoveryRsps, setNumInitialMembers, setTimeout, staggerTimeout, staggerTimeout, timeout, timeout, up, useDiskCache, useDiskCache, write
accept, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, up
public void setInitialHosts(java.util.List<java.net.InetSocketAddress> hosts)
public java.util.List<java.net.InetSocketAddress> getInitialHosts()
public void init() throws java.lang.Exception
Protocol
public void start() throws java.lang.Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start
在类中 Discovery
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
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 flushedpublic void destroy()
Protocol
Channel.close()
.
Does some cleanup; after the call the VM will terminatepublic void handleConnect()
handleConnect
在类中 Discovery
public void handleDisconnect()
handleDisconnect
在类中 Discovery
public void findMembers(java.util.List<Address> members, boolean initial_discovery, Responses responses)
Discovery
Responses
object. If Discovery.async_discovery
is true, this method will be called
in a separate thread, otherwise the caller's thread will be used.findMembers
在类中 Discovery
members
- A list of logical addresses (typically UUID
s). If null, then information
for all members is fetchedinitial_discovery
- Set to true if this is for the initial membership discovery. Some protocols (e.g.
file based ones) may return only the information for the coordinator(s).responses
- The list to which responses should be addedpublic void addInitialHost(java.lang.String hostname, int port)
public boolean removeInitialHost(java.lang.String hostname, int port)
protected void connectAllStubs(java.lang.String group, Address logical_addr)
protected void connect(RouterStub stub, java.lang.String group, Address logical_addr)