Package org.jgroups.protocols
Class LOCAL_PING
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.LOCAL_PING
- All Implemented Interfaces:
Lifecycle
Discovery protocol for finding members in the local process only. Doesn't send discovery requests and responses, but
fetches discovery information directly from a hashmap. Used mainly by unit test.
- Since:
- 4.1.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.DiscoveryCacheDisseminationTask -
Field Summary
FieldsModifier and TypeFieldDescriptionMap of cluster names and address-protocol mappings.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 TypeMethodDescriptionprotected voidaddAddressToLocalCache(Address addr, PhysicalAddress phys_addr) static voidclear()An event is to be sent down the stack.findMembers(List<Address> members, boolean initial_discovery, boolean async, long timeout) voidfindMembers(List<Address> members, boolean initial_discovery, Responses responses) Fetches information (e.g.static intvoidvoidbooleanstatic Stringprint()voidstop()Called on aJChannel.disconnect(); stops work (e.g.Methods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, 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, 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
-
discovery
Map of cluster names and address-protocol mappings. Used for routing messages to all or single members -
FUNC
-
-
Constructor Details
-
LOCAL_PING
public LOCAL_PING()
-
-
Method Details
-
isDynamic
public boolean isDynamic() -
stop
public void stop()Description copied from class:ProtocolCalled on aJChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom. -
clear
public static void clear() -
print
-
getDiscoveryCacheSize
public static int getDiscoveryCacheSize() -
findMembers
public Responses findMembers(List<Address> members, boolean initial_discovery, boolean async, long timeout) - Overrides:
findMembersin 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
-
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(). -
handleConnect
public void handleConnect()- Overrides:
handleConnectin classDiscovery
-
handleDisconnect
public void handleDisconnect()- Overrides:
handleDisconnectin classDiscovery
-
addAddressToLocalCache
-