Class RolloverRequest

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

public class RolloverRequest extends TimedRequest implements org.elasticsearch.xcontent.ToXContentObject
Request class to swap index under an alias upon satisfying conditions
  • Constructor Details

    • RolloverRequest

      public RolloverRequest(String alias, String newIndexName)
  • Method Details

    • getAlias

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

      public 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.core.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 Map<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.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException