Class RolloverRequest

All Implemented Interfaces:
IndicesRequest, AckedRequest, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, TaskAwareRequest

public class RolloverRequest
extends AcknowledgedRequest<RolloverRequest>
implements IndicesRequest, org.elasticsearch.common.xcontent.ToXContentObject
Request class to swap index under an alias or increment data stream generation upon satisfying conditions Note: there is a new class with the same name for the Java HLRC that uses a typeless format. Any changes done to this class should also go to that client class.
  • Constructor Details

    • RolloverRequest

      public RolloverRequest​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
    • RolloverRequest

      public RolloverRequest​(java.lang.String rolloverTarget, java.lang.String newIndexName)
  • Method Details

    • validate

      Specified by:
      validate in class ActionRequest
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class AcknowledgedRequest<RolloverRequest>
      Throws:
      java.io.IOException
    • indices

      public java.lang.String[] indices()
      Description copied from interface: IndicesRequest
      Returns the array of indices that the action relates to
      Specified by:
      indices in interface IndicesRequest
    • indicesOptions

      public IndicesOptions indicesOptions()
      Description copied from interface: IndicesRequest
      Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
      Specified by:
      indicesOptions in interface IndicesRequest
    • setRolloverTarget

      public void setRolloverTarget​(java.lang.String rolloverTarget)
      Sets the rollover target to rollover to another index
    • setNewIndexName

      public void setNewIndexName​(java.lang.String newIndexName)
      Sets the alias to rollover to another index
    • dryRun

      public void dryRun​(boolean dryRun)
      Sets if the rollover should not be executed when conditions are met
    • setWaitForActiveShards

      public void setWaitForActiveShards​(ActiveShardCount waitForActiveShards)
      Sets the wait for active shards configuration for the rolled index that gets created.
    • addMaxIndexAgeCondition

      public void addMaxIndexAgeCondition​(org.elasticsearch.common.unit.TimeValue age)
      Adds condition to check if the index is at least age old
    • addMaxIndexDocsCondition

      public void addMaxIndexDocsCondition​(long numDocs)
      Adds condition to check if the index has at least numDocs
    • addMaxIndexSizeCondition

      public void addMaxIndexSizeCondition​(ByteSizeValue size)
      Adds a size-based condition to check if the index size is at least size.
    • isDryRun

      public boolean isDryRun()
    • getConditions

      public java.util.Map<java.lang.String,​Condition<?>> getConditions()
    • getRolloverTarget

      public java.lang.String getRolloverTarget()
    • getNewIndexName

      public java.lang.String getNewIndexName()
    • getCreateIndexRequest

      public CreateIndexRequest getCreateIndexRequest()
      Returns the inner CreateIndexRequest. Allows to configure mappings, settings and aliases for the new index.
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • fromXContent

      public void fromXContent​(boolean isTypeIncluded, org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException