Class Pipeline

java.lang.Object
org.elasticsearch.ingest.Pipeline

public final class Pipeline
extends java.lang.Object
A pipeline is a list of Processor instances grouped under a unique id.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String DESCRIPTION_KEY  
    static java.lang.String ON_FAILURE_KEY  
    static java.lang.String PROCESSORS_KEY  
    static java.lang.String VERSION_KEY  
  • Constructor Summary

    Constructors
    Constructor Description
    Pipeline​(java.lang.String id, java.lang.String description, java.lang.Integer version, CompoundProcessor compoundProcessor)  
  • Method Summary

    Modifier and Type Method Description
    static Pipeline create​(java.lang.String id, java.util.Map<java.lang.String,​java.lang.Object> config, java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService)  
    void execute​(IngestDocument ingestDocument, java.util.function.BiConsumer<IngestDocument,​java.lang.Exception> handler)
    Modifies the data of a document to be indexed based on the processor this pipeline holds If null is returned then this document will be dropped and not indexed, otherwise this document will be kept and indexed.
    java.util.List<Processor> flattenAllProcessors()
    Flattens the normal and on failure processors into a single list.
    CompoundProcessor getCompoundProcessor()
    Get the underlying CompoundProcessor containing the Pipeline's processors
    java.lang.String getDescription()
    An optional description of what this pipeline is doing to the data gets processed by this pipeline.
    java.lang.String getId()
    The unique id of this pipeline
    org.elasticsearch.ingest.IngestMetric getMetrics()
    The metrics associated with this pipeline.
    java.util.List<Processor> getOnFailureProcessors()
    Unmodifiable list containing each on_failure processor that operates on the data in case of exception thrown in pipeline processors
    java.util.List<Processor> getProcessors()
    Unmodifiable list containing each processor that operates on the data.
    java.lang.Integer getVersion()
    An optional version stored with the pipeline so that it can be used to determine if the pipeline should be updated / replaced.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Pipeline

      public Pipeline​(java.lang.String id, @Nullable java.lang.String description, @Nullable java.lang.Integer version, CompoundProcessor compoundProcessor)
  • Method Details

    • create

      public static Pipeline create​(java.lang.String id, java.util.Map<java.lang.String,​java.lang.Object> config, java.util.Map<java.lang.String,​Processor.Factory> processorFactories, ScriptService scriptService) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • execute

      public void execute​(IngestDocument ingestDocument, java.util.function.BiConsumer<IngestDocument,​java.lang.Exception> handler)
      Modifies the data of a document to be indexed based on the processor this pipeline holds If null is returned then this document will be dropped and not indexed, otherwise this document will be kept and indexed.
    • getId

      public java.lang.String getId()
      The unique id of this pipeline
    • getDescription

      @Nullable public java.lang.String getDescription()
      An optional description of what this pipeline is doing to the data gets processed by this pipeline.
    • getVersion

      @Nullable public java.lang.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:
      null if not supplied.
    • getCompoundProcessor

      public CompoundProcessor getCompoundProcessor()
      Get the underlying CompoundProcessor containing the Pipeline's processors
    • getProcessors

      public java.util.List<Processor> getProcessors()
      Unmodifiable list containing each processor that operates on the data.
    • getOnFailureProcessors

      public java.util.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 java.util.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.