Package org.elasticsearch.client.indices
Class ResizeRequest
java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.ResizeRequest
- All Implemented Interfaces:
Validatable
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentObject
public class ResizeRequest
extends TimedRequest
implements Validatable, org.elasticsearch.xcontent.ToXContentObject
Request class to resize an index
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.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.xcontent.ToXContent
EMPTY_PARAMS
Fields inherited from interface org.elasticsearch.client.Validatable
EMPTY
-
Constructor Summary
ConstructorDescriptionResizeRequest
(String targetIndex, String sourceIndex) Creates a new resize request -
Method Summary
Modifier and TypeMethodDescriptionReturns the Aliases to be used on the target indexReturn the max primary shard size of the target indexReturns the Settings to be used on the target indexReturns the source index nameReturns the target index namesetAliases
(List<Alias> aliases) Sets the Aliases to be used on the target indexvoid
setMaxPrimaryShardSize
(ByteSizeValue maxPrimaryShardSize) Sets the max primary shard size of the target indexsetSettings
(Settings settings) Sets the Settings to be used on the target indexsetWaitForActiveShards
(int waitForActiveShards) A shortcut forsetWaitForActiveShards(ActiveShardCount)
where the numerical shard count is passed in, instead of having to first callActiveShardCount.from(int)
to get the ActiveShardCount.setWaitForActiveShards
(ActiveShardCount waitForActiveShards) Sets the number of shard copies that should be active for creation of the new shrunken index to return.org.elasticsearch.xcontent.XContentBuilder
toXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) validate()
Perform validation.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.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
ResizeRequest
Creates a new resize request- Parameters:
targetIndex
- the new index to create with resized shardssourceIndex
- the index to resize
-
-
Method Details
-
setSettings
Sets the Settings to be used on the target index -
getSettings
Returns the Settings to be used on the target index -
setAliases
Sets the Aliases to be used on the target index -
getAliases
Returns the Aliases to be used on the target index -
setMaxPrimaryShardSize
Sets the max primary shard size of the target index -
getMaxPrimaryShardSize
Return the max primary shard size of the target index -
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. AValidationException
that is not null is assumed to contain validation errors and will be thrown.- Specified by:
validate
in interfaceValidatable
- Returns:
- An
Optional
ValidationException
that contains a list of validation errors.
-
getTargetIndex
Returns the target index name -
getSourceIndex
Returns the source index name -
setWaitForActiveShards
Sets the number of shard copies that should be active for creation of the new shrunken index to return. Defaults toActiveShardCount.DEFAULT
, which will wait for one shard copy (the primary) to become active. Set this value toActiveShardCount.ALL
to wait for all shards (primary and all replicas) to be active before returning. Otherwise, useActiveShardCount.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. CheckShardsAcknowledgedResponse.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
A shortcut forsetWaitForActiveShards(ActiveShardCount)
where the numerical shard count is passed in, instead of having to first callActiveShardCount.from(int)
to get the ActiveShardCount. -
getWaitForActiveShards
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceorg.elasticsearch.xcontent.ToXContent
- Throws:
IOException
-