java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.readiness.ReadinessService
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClusterStateListener
,LifecycleComponent
,Releasable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A listener to be notified when the readiness service establishes the port it's listening on. -
Field Summary
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener for bound readiness service address.Returns the current bound address for the readiness service.void
Called when cluster state changes.protected void
doClose()
protected void
doStart()
protected void
doStop()
static boolean
enabled
(Environment environment) Checks to see if the readiness service is enabled in the current environmentMethods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, start, stop
-
Field Details
-
PORT
-
-
Constructor Details
-
ReadinessService
-
-
Method Details
-
enabled
Checks to see if the readiness service is enabled in the current environment- Parameters:
environment
-- Returns:
-
boundAddress
Returns the current bound address for the readiness service. If Elasticsearch was never ready, this method will return null.- Returns:
- the bound address for the readiness service
-
doStart
protected void doStart()- Specified by:
doStart
in classAbstractLifecycleComponent
-
doStop
protected void doStop()- Specified by:
doStop
in classAbstractLifecycleComponent
-
doClose
protected void doClose()- Specified by:
doClose
in classAbstractLifecycleComponent
-
clusterChanged
Description copied from interface:ClusterStateListener
Called when cluster state changes.Cluster states are applied one-by-one which means they can be a performance bottleneck. Implementations of this method should therefore be fast, so please consider forking work into the background rather than doing everything inline.
- Specified by:
clusterChanged
in interfaceClusterStateListener
-
addBoundAddressListener
Add a listener for bound readiness service address.- Parameters:
listener
-
-