Package org.elasticsearch.discovery.zen
Class UnicastZenPing
java.lang.Object
org.elasticsearch.discovery.zen.UnicastZenPing
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable,ZenPing
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic classstatic classNested classes/interfaces inherited from interface org.elasticsearch.discovery.zen.ZenPing
ZenPing.PingCollection, ZenPing.PingResponse -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnicastZenPing(Settings settings, ThreadPool threadPool, TransportService transportService, SeedHostsProvider seedHostsProvider, PingContextProvider contextProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the list of cached ping responses.voidclose()protected voidfinishPingingRound(UnicastZenPing.PingingRound pingingRound)getPingResponseHandler(UnicastZenPing.PingingRound pingingRound, DiscoveryNode node)protected Versionvoidping(Consumer<ZenPing.PingCollection> resultsConsumer, org.elasticsearch.core.TimeValue duration)Sends three rounds of pings notifying the specifiedConsumerwhen pinging is complete.protected voidping(Consumer<ZenPing.PingCollection> resultsConsumer, org.elasticsearch.core.TimeValue scheduleDuration, org.elasticsearch.core.TimeValue requestDuration)a variant ofping(Consumer, TimeValue), but allows separating the scheduling duration from the duration used for request level time outs.protected voidsendPings(org.elasticsearch.core.TimeValue timeout, UnicastZenPing.PingingRound pingingRound)voidstart()protected voidsubmitToExecutor(AbstractRunnable abstractRunnable)
-
Field Details
-
ACTION_NAME
- See Also:
- Constant Field Values
-
unicastZenPingExecutorService
-
-
Constructor Details
-
UnicastZenPing
public UnicastZenPing(Settings settings, ThreadPool threadPool, TransportService transportService, SeedHostsProvider seedHostsProvider, PingContextProvider contextProvider)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
start
public void start() -
clearTemporalResponses
public void clearTemporalResponses()Clears the list of cached ping responses. -
ping
public void ping(Consumer<ZenPing.PingCollection> resultsConsumer, org.elasticsearch.core.TimeValue duration)Sends three rounds of pings notifying the specifiedConsumerwhen pinging is complete. Pings are sent after resolving configured unicast hosts to their IP address (subject to DNS caching within the JVM). A batch of pings is sent, then another batch of pings is sent at half the specifiedTimeValue, and then another batch of pings is sent at the specifiedTimeValue. The pings that are sent carry a timeout of 1.25 times the specifiedTimeValue. When pinging each node, a connection and handshake is performed, with a connection timeout of the specifiedTimeValue. -
ping
protected void ping(Consumer<ZenPing.PingCollection> resultsConsumer, org.elasticsearch.core.TimeValue scheduleDuration, org.elasticsearch.core.TimeValue requestDuration)a variant ofping(Consumer, TimeValue), but allows separating the scheduling duration from the duration used for request level time outs. This is useful for testing -
finishPingingRound
-
sendPings
protected void sendPings(org.elasticsearch.core.TimeValue timeout, UnicastZenPing.PingingRound pingingRound) -
submitToExecutor
-
getPingResponseHandler
protected TransportResponseHandler<UnicastZenPing.UnicastPingResponse> getPingResponseHandler(UnicastZenPing.PingingRound pingingRound, DiscoveryNode node) -
getVersion
-