Package org.jgroups.protocols
Class PING
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.Discovery
-
- org.jgroups.protocols.PING
-
- All Implemented Interfaces:
Lifecycle
public class PING extends Discovery
The PING protocol retrieves the initial membership by mcasting a discovery request (via the multicast capable transport) to all current cluster members The responses should allow us to determine the coordinator which we have to contact, e.g. in case we want to join the group. When we are a server (after having received the BECOME_SERVER event), we'll respond to discovery requests with a discovery response.- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.DiscoveryCacheDisseminationTask
-
-
Field Summary
-
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, WHITESPACE
-
Fields 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 Constructor Description PING()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
findMembers(java.util.List<Address> members, boolean initial_discovery, Responses responses)
Fetches information (e.g.boolean
isDynamic()
protected void
sendDiscoveryRequest(java.lang.String cluster_name, java.util.List<Address> members_to_find, boolean initial_discovery)
protected void
sendMcastDiscoveryRequest(Message msg)
-
Methods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, down, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, handleDiscoveryResponse, init, 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, write
-
Methods 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
-
-
-
-
Method Detail
-
findMembers
public void findMembers(java.util.List<Address> members, boolean initial_discovery, Responses responses)
Description copied from class:Discovery
Fetches information (e.g. physical address, logical name) for the given member addresses. Needs to add responses to theResponses
object. IfDiscovery.async_discovery
is true, this method will be called in a separate thread, otherwise the caller's thread will be used.- Specified by:
findMembers
in classDiscovery
- Parameters:
members
- A list of logical addresses (typicallyUUID
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 added
-
sendDiscoveryRequest
protected void sendDiscoveryRequest(java.lang.String cluster_name, java.util.List<Address> members_to_find, boolean initial_discovery) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendMcastDiscoveryRequest
protected void sendMcastDiscoveryRequest(Message msg)
-
-