Package org.elasticsearch.ingest
Class Pipeline
- java.lang.Object
-
- org.elasticsearch.ingest.Pipeline
-
-
Field Summary
Fields Modifier and Type Field Description static StringDESCRIPTION_KEYstatic StringON_FAILURE_KEYstatic StringPROCESSORS_KEYstatic StringVERSION_KEY
-
Constructor Summary
Constructors Constructor Description Pipeline(String id, String description, Integer version, CompoundProcessor compoundProcessor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Pipelinecreate(String id, Map<String,Object> config, Map<String,Processor.Factory> processorFactories, ScriptService scriptService)voidexecute(IngestDocument ingestDocument, BiConsumer<IngestDocument,Exception> handler)Modifies the data of a document to be indexed based on the processor this pipeline holds Ifnullis returned then this document will be dropped and not indexed, otherwise this document will be kept and indexed.List<Processor>flattenAllProcessors()Flattens the normal and on failure processors into a single list.CompoundProcessorgetCompoundProcessor()Get the underlyingCompoundProcessorcontaining the Pipeline's processorsStringgetDescription()An optional description of what this pipeline is doing to the data gets processed by this pipeline.StringgetId()The unique id of this pipelineorg.elasticsearch.ingest.IngestMetricgetMetrics()The metrics associated with this pipeline.List<Processor>getOnFailureProcessors()Unmodifiable list containing each on_failure processor that operates on the data in case of exception thrown in pipeline processorsList<Processor>getProcessors()Unmodifiable list containing each processor that operates on the data.IntegergetVersion()An optional version stored with the pipeline so that it can be used to determine if the pipeline should be updated / replaced.
-
-
-
Field Detail
-
DESCRIPTION_KEY
public static final String DESCRIPTION_KEY
- See Also:
- Constant Field Values
-
PROCESSORS_KEY
public static final String PROCESSORS_KEY
- See Also:
- Constant Field Values
-
VERSION_KEY
public static final String VERSION_KEY
- See Also:
- Constant Field Values
-
ON_FAILURE_KEY
public static final String ON_FAILURE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static Pipeline create(String id, Map<String,Object> config, Map<String,Processor.Factory> processorFactories, ScriptService scriptService) throws Exception
- Throws:
Exception
-
execute
public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument,Exception> handler)
Modifies the data of a document to be indexed based on the processor this pipeline holds Ifnullis returned then this document will be dropped and not indexed, otherwise this document will be kept and indexed.
-
getId
public String getId()
The unique id of this pipeline
-
getDescription
@Nullable public String getDescription()
An optional description of what this pipeline is doing to the data gets processed by this pipeline.
-
getVersion
@Nullable public Integer getVersion()
An optional version stored with the pipeline so that it can be used to determine if the pipeline should be updated / replaced.- Returns:
nullif not supplied.
-
getCompoundProcessor
public CompoundProcessor getCompoundProcessor()
Get the underlyingCompoundProcessorcontaining the Pipeline's processors
-
getProcessors
public List<Processor> getProcessors()
Unmodifiable list containing each processor that operates on the data.
-
getOnFailureProcessors
public List<Processor> getOnFailureProcessors()
Unmodifiable list containing each on_failure processor that operates on the data in case of exception thrown in pipeline processors
-
flattenAllProcessors
public List<Processor> flattenAllProcessors()
Flattens the normal and on failure processors into a single list. The original order is lost. This can be useful for pipeline validation purposes.
-
getMetrics
public org.elasticsearch.ingest.IngestMetric getMetrics()
The metrics associated with this pipeline.
-
-