Class RolloverRequest

java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.rollover.RolloverRequest
All Implemented Interfaces:
Validatable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public class RolloverRequest
extends TimedRequest
implements org.elasticsearch.common.xcontent.ToXContentObject
Request class to swap index under an alias upon satisfying conditions
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields inherited from class org.elasticsearch.client.TimedRequest

    DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUT

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS

    Fields inherited from interface org.elasticsearch.client.Validatable

    EMPTY
  • Constructor Summary

    Constructors
    Constructor Description
    RolloverRequest​(java.lang.String alias, java.lang.String newIndexName)  
  • Method Summary

    Modifier and Type Method Description
    RolloverRequest addMaxIndexAgeCondition​(org.elasticsearch.common.unit.TimeValue age)
    Adds condition to check if the index is at least age old
    RolloverRequest addMaxIndexDocsCondition​(long numDocs)
    Adds condition to check if the index has at least numDocs
    RolloverRequest addMaxIndexSizeCondition​(org.elasticsearch.common.unit.ByteSizeValue size)
    Adds a size-based condition to check if the index size is at least size.
    RolloverRequest addMaxPrimaryShardSizeCondition​(org.elasticsearch.common.unit.ByteSizeValue size)
    Adds a size-based condition to check if the size of the largest primary shard is at least size.
    RolloverRequest dryRun​(boolean dryRun)
    Sets if the rollover should not be executed when conditions are met
    java.lang.String getAlias()
    Returns the alias of the rollover operation
    java.util.Map<java.lang.String,​org.elasticsearch.action.admin.indices.rollover.Condition<?>> getConditions()
    Returns all set conditions
    CreateIndexRequest getCreateIndexRequest()
    Returns the inner CreateIndexRequest.
    java.lang.String getNewIndexName()
    Returns the new index name for the rollover
    boolean isDryRun()
    Returns if the rollover should not be executed when conditions are met
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  

    Methods inherited from class org.elasticsearch.client.TimedRequest

    masterNodeTimeout, setMasterTimeout, setTimeout, timeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

    isFragment

    Methods inherited from interface org.elasticsearch.client.Validatable

    validate
  • Constructor Details

    • RolloverRequest

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

    • getAlias

      public java.lang.String getAlias()
      Returns the alias of the rollover operation
    • getNewIndexName

      public java.lang.String getNewIndexName()
      Returns the new index name for the rollover
    • dryRun

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

      public boolean isDryRun()
      Returns if the rollover should not be executed when conditions are met
    • addMaxIndexAgeCondition

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

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

      public RolloverRequest addMaxIndexSizeCondition​(org.elasticsearch.common.unit.ByteSizeValue size)
      Adds a size-based condition to check if the index size is at least size.
    • addMaxPrimaryShardSizeCondition

      public RolloverRequest addMaxPrimaryShardSizeCondition​(org.elasticsearch.common.unit.ByteSizeValue size)
      Adds a size-based condition to check if the size of the largest primary shard is at least size.
    • getConditions

      public java.util.Map<java.lang.String,​org.elasticsearch.action.admin.indices.rollover.Condition<?>> getConditions()
      Returns all set conditions
    • 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