Package org.elasticsearch.ingest
Class IngestService
java.lang.Object
org.elasticsearch.ingest.IngestService
- All Implemented Interfaces:
ClusterStateApplier
,ReportingService<IngestInfo>
public class IngestService
extends Object
implements ClusterStateApplier, ReportingService<IngestInfo>
Holder class for several ingest related services.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.node.ReportingService
ReportingService.Info
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIngestService(ClusterService clusterService, ThreadPool threadPool, Environment env, ScriptService scriptService, AnalysisRegistry analysisRegistry, List<IngestPlugin> ingestPlugins, Client client)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIngestClusterStateListener(Consumer<ClusterState> listener)
Adds a listener that gets invoked with the current cluster state before processor factories get invoked.void
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(int numberOfActionRequests, Iterable<DocWriteRequest<?>> actionRequests, BiConsumer<Integer,Exception> onFailure, BiConsumer<Thread,Exception> onCompletion, IntConsumer onDropped, String executorName)
getPipeline(String id)
Returns the pipeline by the specified idstatic List<PipelineConfiguration>
getPipelines(ClusterState clusterState, String... ids)
getProcessorsInPipeline(String pipelineId, Class<P> clazz)
Gets all the Processors of the given type from within a Pipeline.info()
static ClusterState
innerPut(PutPipelineRequest request, ClusterState currentState)
void
putPipeline(Map<DiscoveryNode,IngestInfo> ingestInfos, PutPipelineRequest request, ActionListener<AcknowledgedResponse> listener)
Stores the specified pipeline definition in the request.static boolean
resolvePipelines(DocWriteRequest<?> originalRequest, IndexRequest indexRequest, Metadata metadata)
static boolean
resolvePipelines(DocWriteRequest<?> originalRequest, IndexRequest indexRequest, Metadata metadata, long epochMillis)
stats()
-
Field Details
-
NOOP_PIPELINE_NAME
- See Also:
- Constant Field Values
-
INGEST_ORIGIN
- See Also:
- Constant Field Values
-
-
Constructor Details
-
IngestService
public IngestService(ClusterService clusterService, ThreadPool threadPool, Environment env, ScriptService scriptService, AnalysisRegistry analysisRegistry, List<IngestPlugin> ingestPlugins, Client client)
-
-
Method Details
-
resolvePipelines
public static boolean resolvePipelines(DocWriteRequest<?> originalRequest, IndexRequest indexRequest, Metadata metadata) -
resolvePipelines
public static boolean resolvePipelines(DocWriteRequest<?> originalRequest, IndexRequest indexRequest, Metadata metadata, long epochMillis) -
getClusterService
-
getScriptService
-
delete
Deletes the pipeline specified by id in the request. -
getPipelines
- Returns:
- pipeline configuration specified by id. If multiple ids or wildcards are specified multiple pipelines may be returned
-
putPipeline
public void putPipeline(Map<DiscoveryNode,IngestInfo> ingestInfos, PutPipelineRequest request, ActionListener<AcknowledgedResponse> listener) throws ExceptionStores the specified pipeline definition in the request.- Throws:
Exception
-
getPipeline
Returns the pipeline by the specified id -
getProcessorFactories
-
info
- Specified by:
info
in interfaceReportingService<IngestInfo>
-
innerPut
-
executeBulkRequest
public void executeBulkRequest(int numberOfActionRequests, Iterable<DocWriteRequest<?>> actionRequests, BiConsumer<Integer,Exception> onFailure, BiConsumer<Thread,Exception> onCompletion, IntConsumer onDropped, String executorName) -
stats
-
addIngestClusterStateListener
Adds a listener that gets invoked with the current cluster state before processor factories get invoked. This is useful for components that are used by ingest processors, so that they have the opportunity to update before these components get used by the ingest processor factory. -
applyClusterState
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
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
-