public class ClusterHealthRequest extends MasterNodeReadRequest<ClusterHealthRequest> implements IndicesRequest.Replaceable
TransportRequest.Empty
IndicesRequest.Replaceable
local
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
Constructor and Description |
---|
ClusterHealthRequest() |
ClusterHealthRequest(java.lang.String... indices) |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
indices()
Returns the array of indices that the action relates to
|
ClusterHealthRequest |
indices(java.lang.String... indices)
Sets the 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.
|
TimeValue |
timeout() |
ClusterHealthRequest |
timeout(java.lang.String timeout) |
ClusterHealthRequest |
timeout(TimeValue timeout) |
ActionRequestValidationException |
validate() |
ActiveShardCount |
waitForActiveShards() |
ClusterHealthRequest |
waitForActiveShards(ActiveShardCount waitForActiveShards)
Sets the number of shard copies that must be active across all indices before getting the
health status.
|
ClusterHealthRequest |
waitForActiveShards(int waitForActiveShards)
A shortcut for
waitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount. |
Priority |
waitForEvents() |
ClusterHealthRequest |
waitForEvents(Priority waitForEvents) |
ClusterHealthRequest |
waitForGreenStatus() |
java.lang.String |
waitForNodes() |
ClusterHealthRequest |
waitForNodes(java.lang.String waitForNodes)
Waits for N number of nodes.
|
boolean |
waitForNoRelocatingShards() |
ClusterHealthRequest |
waitForNoRelocatingShards(boolean waitForNoRelocatingShards)
Sets whether the request should wait for there to be no relocating shards before
retrieving the cluster health status.
|
ClusterHealthStatus |
waitForStatus() |
ClusterHealthRequest |
waitForStatus(ClusterHealthStatus waitForStatus) |
ClusterHealthRequest |
waitForYellowStatus() |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
local, local
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
getShouldStoreResult
getParentTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTask, getDescription, setParentTask
public ClusterHealthRequest()
public ClusterHealthRequest(java.lang.String... indices)
public java.lang.String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public ClusterHealthRequest indices(java.lang.String... indices)
IndicesRequest.Replaceable
indices
in interface IndicesRequest.Replaceable
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public TimeValue timeout()
public ClusterHealthRequest timeout(TimeValue timeout)
public ClusterHealthRequest timeout(java.lang.String timeout)
public ClusterHealthStatus waitForStatus()
public ClusterHealthRequest waitForStatus(ClusterHealthStatus waitForStatus)
public ClusterHealthRequest waitForGreenStatus()
public ClusterHealthRequest waitForYellowStatus()
public boolean waitForNoRelocatingShards()
public ClusterHealthRequest waitForNoRelocatingShards(boolean waitForNoRelocatingShards)
false
, meaning the
operation does not wait on there being no more relocating shards. Set to true
to wait until the number of relocating shards in the cluster is 0.public ActiveShardCount waitForActiveShards()
public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards)
ActiveShardCount.NONE
, meaning we don't wait on any active shards.
Set this value to ActiveShardCount.ALL
to wait for all shards (primary and
all replicas) to be active across all indices in the cluster. Otherwise, use
ActiveShardCount.from(int)
to set this value to any non-negative integer, up to the
total number of shard copies to wait for.public ClusterHealthRequest waitForActiveShards(int waitForActiveShards)
waitForActiveShards(ActiveShardCount)
where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.public java.lang.String waitForNodes()
public ClusterHealthRequest waitForNodes(java.lang.String waitForNodes)
public ClusterHealthRequest waitForEvents(Priority waitForEvents)
public Priority waitForEvents()
public ActionRequestValidationException validate()
validate
in class ActionRequest
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class MasterNodeReadRequest<ClusterHealthRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class MasterNodeReadRequest<ClusterHealthRequest>
java.io.IOException