public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implements IndicesRequest
TransportRequest.Empty
IndicesRequest.Replaceable
Modifier and Type | Field and Description |
---|---|
static ObjectParser<RolloverRequest,java.lang.Void> |
PARSER |
DEFAULT_ACK_TIMEOUT, timeout
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor and Description |
---|
RolloverRequest(java.lang.String alias,
java.lang.String newIndexName) |
Modifier and Type | Method and Description |
---|---|
void |
addMaxIndexAgeCondition(TimeValue age)
Adds condition to check if the index is at least
age old |
void |
addMaxIndexDocsCondition(long numDocs)
Adds condition to check if the index has at least
numDocs |
void |
dryRun(boolean dryRun)
Sets if the rollover should not be executed when conditions are met
|
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 |
setAlias(java.lang.String alias)
Sets the alias to rollover to another index
|
void |
setCreateIndexRequest(CreateIndexRequest createIndexRequest)
Sets rollover index creation request to override index settings when
the rolled over index has to be created
|
void |
setNewIndexName(java.lang.String newIndexName)
Sets the alias to rollover to another index
|
void |
setWaitForActiveShards(ActiveShardCount waitForActiveShards)
Sets the number of shard copies that should be active for creation of the
new rollover 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<RolloverRequest,java.lang.Void> PARSER
public RolloverRequest(java.lang.String alias, java.lang.String newIndexName)
public ActionRequestValidationException validate()
validate
in class ActionRequest
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class AcknowledgedRequest<RolloverRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class AcknowledgedRequest<RolloverRequest>
java.io.IOException
public java.lang.String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public void setAlias(java.lang.String alias)
public void setNewIndexName(java.lang.String newIndexName)
public void dryRun(boolean dryRun)
public void addMaxIndexAgeCondition(TimeValue age)
age
oldpublic void addMaxIndexDocsCondition(long numDocs)
numDocs
public void setCreateIndexRequest(CreateIndexRequest createIndexRequest)
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 RolloverResponse.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.