Class ReservedPipelineAction

java.lang.Object
org.elasticsearch.action.ingest.ReservedPipelineAction
All Implemented Interfaces:
ReservedClusterStateHandler<List<PutPipelineRequest>>

public class ReservedPipelineAction extends Object implements ReservedClusterStateHandler<List<PutPipelineRequest>>
This Action is the reserved state save version of RestPutPipelineAction/RestDeletePipelineAction

It is used by the ReservedClusterStateService to add/update or remove ingest pipelines. Typical usage for this action is in the context of file based state.

  • Field Details

  • Constructor Details

    • ReservedPipelineAction

      public ReservedPipelineAction()
      Creates a ReservedPipelineAction
  • Method Details

    • name

      public String name()
      Description copied from interface: ReservedClusterStateHandler
      Unique identifier for the handler.

      The handler name is a unique identifier that is matched to a section in a cluster state update content. The reserved cluster state updates are done as a single cluster state update and the cluster state is typically supplied as a combined content, unlike the REST handlers. This name must match a desired content key name in the combined cluster state update, e.g. "ilm" or "cluster_settings" (for persistent cluster settings update).

      Specified by:
      name in interface ReservedClusterStateHandler<List<PutPipelineRequest>>
      Returns:
      a String with the handler name, e.g "ilm".
    • transform

      public TransformState transform(Object source, TransformState prevState) throws Exception
      Description copied from interface: ReservedClusterStateHandler
      The transformation method implemented by the handler.

      The transform method of the handler should apply the necessary changes to the cluster state as it normally would in a REST handler. One difference is that the transform method in an reserved state handler must perform all CRUD operations of the cluster state in one go. For that reason, we supply a wrapper class to the cluster state called TransformState, which contains the current cluster state as well as any previous keys set by this handler on prior invocation.

      Specified by:
      transform in interface ReservedClusterStateHandler<List<PutPipelineRequest>>
      Parameters:
      source - The parsed information specific to this handler from the combined cluster state content
      prevState - The previous cluster state and keys set by this handler (if any)
      Returns:
      The modified state and the current keys set by this handler
      Throws:
      Exception
    • fromXContent

      public List<PutPipelineRequest> fromXContent(XContentParser parser) throws IOException
      Description copied from interface: ReservedClusterStateHandler
      The parse content method which is called during parsing of file based content.

      The immutable state can be provided as XContent, which means that each handler needs to implement a method to convert an XContent to an object it can consume later in transform

      Specified by:
      fromXContent in interface ReservedClusterStateHandler<List<PutPipelineRequest>>
      Parameters:
      parser - the XContent parser we are parsing from
      Returns:
      Throws:
      IOException