Package org.elasticsearch.test.discovery
Class MockZenPing
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.test.discovery.MockZenPing
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable,ZenPing
public final class MockZenPing extends AbstractComponent implements ZenPing
AZenPingimplementation which returns results based on a static in-memory map. This allows pinging to be immediate and can be used to speed up tests.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.discovery.zen.ZenPing
ZenPing.PingCollection, ZenPing.PingResponse
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Constructor Description MockZenPing(PingContextProvider contextProvider)
-
Method Summary
Modifier and Type Method Description voidclose()voidping(java.util.function.Consumer<ZenPing.PingCollection> resultsConsumer, TimeValue timeout)voidstart()
-
-
-
Constructor Detail
-
MockZenPing
public MockZenPing(PingContextProvider contextProvider)
-
-
Method Detail
-
ping
public void ping(java.util.function.Consumer<ZenPing.PingCollection> resultsConsumer, TimeValue timeout)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceReleasable
-
-