Module org.elasticsearch.server
Class ResizeRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<ResizeRequest>
org.elasticsearch.action.support.master.AcknowledgedRequest<ResizeRequest>
org.elasticsearch.action.admin.indices.shrink.ResizeRequest
- All Implemented Interfaces:
IndicesRequest,Writeable,RefCounted,TaskAwareRequest,TransportRequest
Request class to shrink an index into a single shard
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.support.master.AcknowledgedRequest
AcknowledgedRequest.PlainNested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.RemoteClusterShardRequest, IndicesRequest.Replaceable, IndicesRequest.SingleIndexNoWildcardsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final ObjectParser<ResizeRequest, Void> Fields inherited from class org.elasticsearch.action.support.master.AcknowledgedRequest
DEFAULT_ACK_TIMEOUTFields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
INFINITE_MASTER_NODE_TIMEOUT, TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUTFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionResizeRequest(TimeValue masterNodeTimeout, TimeValue ackTimeout, ResizeType resizeType, String sourceIndex, String targetIndex) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidfromXContent(XContentParser parser) Returns the max primary shard size of the target indexReturns the type of the resize operationReturns the source index nameReturns theCreateIndexRequestfor the shrink indexinthashCode()String[]indices()Returns the array of indices that the action relates toReturns the indices options used to resolve indices.voidsetCopySettings(Boolean copySettings) voidsetMaxPrimaryShardSize(ByteSizeValue maxPrimaryShardSize) Sets the max primary shard size of the target index.voidsetTargetIndex(CreateIndexRequest targetIndexRequest) voidsetTargetIndexSettings(Settings.Builder settings) voidsetWaitForActiveShards(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.voidsetWaitForActiveShards(ActiveShardCount waitForActiveShards) Sets the number of shard copies that should be active for creation of the new shrunken index to return.validate()voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.AcknowledgedRequest
ackTimeout, ackTimeoutMethods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterTermMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.IndicesRequest
includeDataStreamsMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, createTask, getDescription, setParentTask
-
Field Details
-
PARSER
-
MAX_PRIMARY_SHARD_SIZE
-
-
Constructor Details
-
ResizeRequest
- Throws:
IOException
-
ResizeRequest
public ResizeRequest(TimeValue masterNodeTimeout, TimeValue ackTimeout, ResizeType resizeType, String sourceIndex, String targetIndex)
-
-
Method Details
-
validate
- Overrides:
validatein classAcknowledgedRequest<ResizeRequest>
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classAcknowledgedRequest<ResizeRequest>- Throws:
IOException
-
indices
Description copied from interface:IndicesRequestReturns the array of indices that the action relates to- Specified by:
indicesin interfaceIndicesRequest
-
indicesOptions
Description copied from interface:IndicesRequestReturns 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:
indicesOptionsin interfaceIndicesRequest
-
setTargetIndex
-
getTargetIndexRequest
Returns theCreateIndexRequestfor the shrink index -
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.ALLto 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
public void setWaitForActiveShards(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. -
getResizeType
Returns the type of the resize operation -
setCopySettings
-
getCopySettings
-
setMaxPrimaryShardSize
Sets the max primary shard size of the target index. It's used to calculate an optimum shards number of the target index according to storage of the source index, each shard's storage of the target index will not be greater than this parameter, while the shards number of the target index still be a factor of the source index's shards number.- Parameters:
maxPrimaryShardSize- the max primary shard size of the target index
-
getMaxPrimaryShardSize
Returns the max primary shard size of the target index -
fromXContent
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
setTargetIndexSettings
-