Class ResizeRequest

  • All Implemented Interfaces:
    Validatable, org.opensearch.common.xcontent.ToXContent, org.opensearch.common.xcontent.ToXContentObject

    public class ResizeRequest
    extends TimedRequest
    implements Validatable, org.opensearch.common.xcontent.ToXContentObject
    Request class to resize an index
    • Nested Class Summary

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

        org.opensearch.common.xcontent.ToXContent.DelegatingMapParams, org.opensearch.common.xcontent.ToXContent.MapParams, org.opensearch.common.xcontent.ToXContent.Params
    • Constructor Summary

      Constructors 
      Constructor Description
      ResizeRequest​(java.lang.String targetIndex, java.lang.String sourceIndex)
      Creates a new resize request
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<org.opensearch.action.admin.indices.alias.Alias> getAliases()
      Returns the Aliases to be used on the target index
      org.opensearch.common.settings.Settings getSettings()
      Returns the Settings to be used on the target index
      java.lang.String getSourceIndex()
      Returns the source index name
      java.lang.String getTargetIndex()
      Returns the target index name
      org.opensearch.action.support.ActiveShardCount getWaitForActiveShards()  
      ResizeRequest setAliases​(java.util.List<org.opensearch.action.admin.indices.alias.Alias> aliases)
      Sets the Aliases to be used on the target index
      ResizeRequest setSettings​(org.opensearch.common.settings.Settings settings)
      Sets the Settings to be used on the target index
      ResizeRequest setWaitForActiveShards​(int waitForActiveShards)
      A shortcut for setWaitForActiveShards(ActiveShardCount) where the numerical shard count is passed in, instead of having to first call ActiveShardCount.from(int) to get the ActiveShardCount.
      ResizeRequest setWaitForActiveShards​(org.opensearch.action.support.ActiveShardCount waitForActiveShards)
      Sets the number of shard copies that should be active for creation of the new shrunken index to return.
      org.opensearch.common.xcontent.XContentBuilder toXContent​(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)  
      java.util.Optional<ValidationException> validate()
      Perform validation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.opensearch.common.xcontent.ToXContentObject

        isFragment
    • Constructor Detail

      • ResizeRequest

        public ResizeRequest​(java.lang.String targetIndex,
                             java.lang.String sourceIndex)
        Creates a new resize request
        Parameters:
        targetIndex - the new index to create with resized shards
        sourceIndex - the index to resize
    • Method Detail

      • setSettings

        public ResizeRequest setSettings​(org.opensearch.common.settings.Settings settings)
        Sets the Settings to be used on the target index
      • getSettings

        public org.opensearch.common.settings.Settings getSettings()
        Returns the Settings to be used on the target index
      • setAliases

        public ResizeRequest setAliases​(java.util.List<org.opensearch.action.admin.indices.alias.Alias> aliases)
        Sets the Aliases to be used on the target index
      • getAliases

        public java.util.Set<org.opensearch.action.admin.indices.alias.Alias> getAliases()
        Returns the Aliases to be used on the target index
      • validate

        public java.util.Optional<ValidationException> validate()
        Description copied from interface: Validatable
        Perform validation. This method does not have to be overridden in the event that no validation needs to be done, or the validation was done during object construction time. A ValidationException that is not null is assumed to contain validation errors and will be thrown.
        Specified by:
        validate in interface Validatable
        Returns:
        An Optional ValidationException that contains a list of validation errors.
      • getTargetIndex

        public java.lang.String getTargetIndex()
        Returns the target index name
      • getSourceIndex

        public java.lang.String getSourceIndex()
        Returns the source index name
      • setWaitForActiveShards

        public ResizeRequest setWaitForActiveShards​(org.opensearch.action.support.ActiveShardCount waitForActiveShards)
        Sets the number of shard copies that should be active for creation of the new shrunken index to return. Defaults to ActiveShardCount.DEFAULT, which will wait for one shard copy (the primary) to become active. Set this value to ActiveShardCount.ALL to wait for all shards (primary and all replicas) to be active before returning. Otherwise, use ActiveShardCount.from(int) to set this value to any non-negative integer, up to the number of copies per shard (number of replicas + 1), to wait for the desired amount of shard copies to become active before returning. Index creation will only wait up until the timeout value for the number of shard copies to be active before returning. Check ShardsAcknowledgedResponse.isShardsAcknowledged() to determine if the requisite shard copies were all started before returning or timing out.
        Parameters:
        waitForActiveShards - number of active shard copies to wait on
      • setWaitForActiveShards

        public ResizeRequest setWaitForActiveShards​(int waitForActiveShards)
        A shortcut for setWaitForActiveShards(ActiveShardCount) where the numerical shard count is passed in, instead of having to first call ActiveShardCount.from(int) to get the ActiveShardCount.
      • getWaitForActiveShards

        public org.opensearch.action.support.ActiveShardCount getWaitForActiveShards()
      • toXContent

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