public class ShrinkRequest extends AcknowledgedRequest<ShrinkRequest> implements IndicesRequest
TransportRequest.Empty
IndicesRequest.Replaceable
Modifier and Type | Field and Description |
---|---|
static ObjectParser<ShrinkRequest,java.lang.Void> |
PARSER |
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor and Description |
---|
ShrinkRequest(java.lang.String targetIndex,
java.lang.String sourceindex) |
Modifier and Type | Method and Description |
---|---|
CreateIndexRequest |
getShrinkIndexRequest()
Returns the
CreateIndexRequest for the shrink index |
java.lang.String |
getSourceIndex()
Returns the source index name
|
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 |
setShrinkIndex(CreateIndexRequest shrinkIndexRequest) |
void |
setSourceIndex(java.lang.String index) |
void |
setWaitForActiveShards(ActiveShardCount waitForActiveShards)
Sets the number of shard copies that should be active for creation of the
new shrunken index to return.
|
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. |
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
ackTimeout, readTimeout, timeout, timeout, timeout, writeTimeout
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
getShouldStoreResult
getParentTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterNodeTimeout
createTask, getDescription, setParentTask
public static final ObjectParser<ShrinkRequest,java.lang.Void> PARSER
public ShrinkRequest(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<ShrinkRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class AcknowledgedRequest<ShrinkRequest>
java.io.IOException
public java.lang.String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public void setShrinkIndex(CreateIndexRequest shrinkIndexRequest)
public CreateIndexRequest getShrinkIndexRequest()
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 CreateIndexResponse.isShardsAcked()
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.