Module org.elasticsearch.xcore
Class AsyncTaskMaintenanceService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.xpack.core.async.AsyncTaskMaintenanceService
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterStateListener,LifecycleComponent,org.elasticsearch.core.Releasable
public class AsyncTaskMaintenanceService
extends AbstractLifecycleComponent
implements ClusterStateListener
A service that runs a periodic cleanup over the async execution index.
Since we will have several injected implementation of this class injected into different transports, and we bind components created by Plugin.createComponents(org.elasticsearch.plugins.Plugin.PluginServices) to their classes, we need to implement one class per binding.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Setting<org.elasticsearch.core.TimeValue> Controls the interval at which the cleanup is scheduled.Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle -
Constructor Summary
ConstructorsConstructorDescriptionAsyncTaskMaintenanceService(ClusterService clusterService, ProjectResolver projectResolver, String localNodeId, Settings nodeSettings, ThreadPool threadPool, Client clientWithOrigin) -
Method Summary
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, start, stop
-
Field Details
-
ASYNC_SEARCH_CLEANUP_INTERVAL_SETTING
Controls the interval at which the cleanup is scheduled. Defaults to 1h. It is an undocumented/expert setting that is mainly used by integration tests to make the garbage collection of search responses more reactive.
-
-
Constructor Details
-
AsyncTaskMaintenanceService
public AsyncTaskMaintenanceService(ClusterService clusterService, ProjectResolver projectResolver, String localNodeId, Settings nodeSettings, ThreadPool threadPool, Client clientWithOrigin)
-
-
Method Details
-
doStart
protected void doStart()- Specified by:
doStartin classAbstractLifecycleComponent
-
doStop
protected void doStop()- Specified by:
doStopin classAbstractLifecycleComponent
-
pause
public void pause() -
unpause
public boolean unpause() -
doClose
- Specified by:
doClosein classAbstractLifecycleComponent- Throws:
IOException
-
clusterChanged
- Specified by:
clusterChangedin interfaceClusterStateListener
-