Package org.jgroups.protocols
Class TCPPING
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.TCPPING
- All Implemented Interfaces:
Lifecycle
The TCPPING protocol defines a static cluster membership. The cluster members are retrieved by
directly contacting the members listed in initial_hosts, sending point-to-point discovery requests.
The TCPPING protocol defines a static configuration, which requires that you to know in advance where to find all of the members of your cluster.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.DiscoveryCacheDisseminationTask -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected BoundedList<PhysicalAddress> https://issues.redhat.com/browse/JGRP-989protected Collection<PhysicalAddress> protected Stringprotected booleanprotected Stringprotected intprotected intprotected StackTypeprotected Collection<String> Fields inherited from class org.jgroups.protocols.Discovery
async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACEFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends TCPPING>
TvoiddiscoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) An event is to be sent down the stack.voidfindMembers(List<Address> members, boolean initial_discovery, Responses responses) Fetches information (e.g.Returns the list of initial hosts as configured by the user via XML.intprotected static StringhostsToStr(Collection<PhysicalAddress> hosts) voidinit()Called after a protocol has been created and before the protocol is started.<T extends TCPPING>
Tboolean<T extends TCPPING>
TportRange(int r) protected void<T extends TCPPING>
T<T extends TCPPING>
T<T extends TCPPING>
TsetPortRange(int port_range) Methods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, marshal, marshal, print, providedUpServices, read, readPingData, resetStats, returnEntireCache, returnEntireCache, sendCacheInformation, sendCacheOnJoin, sendCacheOnJoin, sendDiscoveryResponse, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, stop, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses, writeMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
Field Details
-
initial_hosts_str
-
initial_hosts_file
-
port_range
protected int port_range -
initial_hosts_set_programmatically
protected boolean initial_hosts_set_programmatically -
unresolved_hosts
-
max_dynamic_hosts
protected int max_dynamic_hosts -
initial_hosts
-
dynamic_hosts
https://issues.redhat.com/browse/JGRP-989 -
default_port
protected int default_port -
stack_type
-
-
Constructor Details
-
TCPPING
public TCPPING()
-
-
Method Details
-
isDynamic
public boolean isDynamic() -
getInitialHosts
Returns the list of initial hosts as configured by the user via XML. Note that the returned list is mutable, so careful with changes !- Returns:
- List of initial hosts. This variable is only set after the channel has been created and set Properties() has been called
-
getResolvedHosts
-
setInitialHosts
-
setInitialHosts2
-
initialHosts
-
getPortRange
public int getPortRange() -
setPortRange
-
portRange
-
getDynamicHostList
-
clearDynamicHostList
-
init
Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent. -
down
Description copied from class:ProtocolAn event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down(). -
discoveryRequestReceived
public void discoveryRequestReceived(Address sender, String logical_name, PhysicalAddress physical_addr) - Overrides:
discoveryRequestReceivedin classDiscovery
-
findMembers
Description copied from class:DiscoveryFetches information (e.g. physical address, logical name) for the given member addresses. Needs to add responses to theResponsesobject. IfDiscovery.async_discoveryis true, this method will be called in a separate thread, otherwise the caller's thread will be used.- Specified by:
findMembersin classDiscovery- Parameters:
members- A list of logical addresses (typicallyUUIDs). 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 added
-
sendDiscoveryRequest
-
hostsToStr
-