Package org.elasticsearch.ingest
Class IngestService
- java.lang.Object
-
- org.elasticsearch.ingest.IngestService
-
- All Implemented Interfaces:
ClusterStateApplier
public class IngestService extends java.lang.Object implements ClusterStateApplier
Holder class for several ingest related services.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NOOP_PIPELINE_NAME
-
Constructor Summary
Constructors Constructor Description IngestService(ClusterService clusterService, ThreadPool threadPool, Environment env, ScriptService scriptService, AnalysisRegistry analysisRegistry, java.util.List<IngestPlugin> ingestPlugins)
-
Method Summary
Modifier and Type Method Description void
applyClusterState(ClusterChangedEvent event)
Called when a new cluster state (ClusterChangedEvent.state()
needs to be applied.void
delete(DeletePipelineRequest request, ActionListener<AcknowledgedResponse> listener)
Deletes the pipeline specified by id in the request.void
executeBulkRequest(java.lang.Iterable<DocWriteRequest<?>> actionRequests, java.util.function.BiConsumer<IndexRequest,java.lang.Exception> itemFailureHandler, java.util.function.Consumer<java.lang.Exception> completionHandler, java.util.function.Consumer<IndexRequest> itemDroppedHandler)
ClusterService
getClusterService()
Pipeline
getPipeline(java.lang.String id)
Returns the pipeline by the specified idstatic java.util.List<PipelineConfiguration>
getPipelines(ClusterState clusterState, java.lang.String... ids)
java.util.Map<java.lang.String,Processor.Factory>
getProcessorFactories()
<P extends Processor>
java.util.List<P>getProcessorsInPipeline(java.lang.String pipelineId, java.lang.Class<P> clazz)
Gets all the Processors of the given type from within a Pipeline.ScriptService
getScriptService()
IngestInfo
info()
static ClusterState
innerPut(PutPipelineRequest request, ClusterState currentState)
void
putPipeline(java.util.Map<DiscoveryNode,IngestInfo> ingestInfos, PutPipelineRequest request, ActionListener<AcknowledgedResponse> listener)
Stores the specified pipeline definition in the request.IngestStats
stats()
-
-
-
Field Detail
-
NOOP_PIPELINE_NAME
public static final java.lang.String NOOP_PIPELINE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IngestService
public IngestService(ClusterService clusterService, ThreadPool threadPool, Environment env, ScriptService scriptService, AnalysisRegistry analysisRegistry, java.util.List<IngestPlugin> ingestPlugins)
-
-
Method Detail
-
getClusterService
public ClusterService getClusterService()
-
getScriptService
public ScriptService getScriptService()
-
delete
public void delete(DeletePipelineRequest request, ActionListener<AcknowledgedResponse> listener)
Deletes the pipeline specified by id in the request.
-
getPipelines
public static java.util.List<PipelineConfiguration> getPipelines(ClusterState clusterState, java.lang.String... ids)
- Returns:
- pipeline configuration specified by id. If multiple ids or wildcards are specified multiple pipelines may be returned
-
putPipeline
public void putPipeline(java.util.Map<DiscoveryNode,IngestInfo> ingestInfos, PutPipelineRequest request, ActionListener<AcknowledgedResponse> listener) throws java.lang.Exception
Stores the specified pipeline definition in the request.- Throws:
java.lang.Exception
-
getPipeline
public Pipeline getPipeline(java.lang.String id)
Returns the pipeline by the specified id
-
getProcessorFactories
public java.util.Map<java.lang.String,Processor.Factory> getProcessorFactories()
-
info
public IngestInfo info()
-
innerPut
public static ClusterState innerPut(PutPipelineRequest request, ClusterState currentState)
-
executeBulkRequest
public void executeBulkRequest(java.lang.Iterable<DocWriteRequest<?>> actionRequests, java.util.function.BiConsumer<IndexRequest,java.lang.Exception> itemFailureHandler, java.util.function.Consumer<java.lang.Exception> completionHandler, java.util.function.Consumer<IndexRequest> itemDroppedHandler)
-
stats
public IngestStats stats()
-
applyClusterState
public void applyClusterState(ClusterChangedEvent event)
Description copied from interface:ClusterStateApplier
Called when a new cluster state (ClusterChangedEvent.state()
needs to be applied. The cluster state to be applied is already committed when this method is called, so an applier must therefore be prepared to deal with any state it receives without throwing an exception. Throwing an exception from an applier is very bad because it will stop the application of this state before it has reached all the other appliers, and will likely result in another attempt to apply the same (or very similar) cluster state which might continue until this node is removed from the cluster.- Specified by:
applyClusterState
in interfaceClusterStateApplier
-
getProcessorsInPipeline
public <P extends Processor> java.util.List<P> getProcessorsInPipeline(java.lang.String pipelineId, java.lang.Class<P> clazz)
Gets all the Processors of the given type from within a Pipeline.- Parameters:
pipelineId
- the pipeline to inspectclazz
- the Processor class to look for- Returns:
- True if the pipeline contains an instance of the Processor class passed in
-
-