IndicesRequest
, AckedRequest
, Streamable
, Writeable
, ToXContent
, ToXContentObject
, TaskAwareRequest
public class ResizeRequest extends AcknowledgedRequest<ResizeRequest> implements IndicesRequest, ToXContentObject
IndicesRequest.Replaceable
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
TransportRequest.Empty
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static ObjectParser<ResizeRequest,java.lang.Void> |
PARSER |
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
EMPTY_PARAMS
Constructor | Description |
---|---|
ResizeRequest(java.lang.String targetIndex,
java.lang.String sourceIndex) |
Modifier and Type | Method | Description |
---|---|---|
void |
fromXContent(XContentParser parser) |
|
ResizeType |
getResizeType() |
Returns the type of the resize operation
|
java.lang.String |
getSourceIndex() |
Returns the source index name
|
CreateIndexRequest |
getTargetIndexRequest() |
Returns the
CreateIndexRequest for the shrink index |
java.lang.String[] |
indices() |
Returns the array of indices that the action relates to
|
IndicesOptions |
indicesOptions() |
Returns the indices options used to resolve indices.
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
void |
setResizeType(ResizeType type) |
The type of the resize operation
|
void |
setSourceIndex(java.lang.String index) |
|
void |
setTargetIndex(CreateIndexRequest targetIndexRequest) |
|
void |
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. |
void |
setWaitForActiveShards(ActiveShardCount waitForActiveShards) |
Sets the number of shard copies that should be active for creation of the
new shrunken index to return.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
ActionRequestValidationException |
validate() |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
masterNodeTimeout
ackTimeout, timeout, timeout, timeout
getShouldStoreResult
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTask, getDescription, setParentTask
isFragment
remoteAddress, remoteAddress
getParentTask, setParentTask
public static final ObjectParser<ResizeRequest,java.lang.Void> PARSER
public ResizeRequest(java.lang.String targetIndex, java.lang.String sourceIndex)
public ActionRequestValidationException validate()
validate
in class ActionRequest
public void setSourceIndex(java.lang.String index)
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class AcknowledgedRequest<ResizeRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in interface Writeable
writeTo
in class AcknowledgedRequest<ResizeRequest>
java.io.IOException
public java.lang.String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public void setTargetIndex(CreateIndexRequest targetIndexRequest)
public CreateIndexRequest getTargetIndexRequest()
CreateIndexRequest
for the shrink indexpublic java.lang.String getSourceIndex()
public void setWaitForActiveShards(ActiveShardCount waitForActiveShards)
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.waitForActiveShards
- number of active shard copies to wait onpublic void setWaitForActiveShards(int waitForActiveShards)
setWaitForActiveShards(ActiveShardCount)
where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.public void setResizeType(ResizeType type)
public ResizeType getResizeType()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public void fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException