public final class ShardAllocationDecision extends java.lang.Object implements ToXContent, Writeable
getAllocateDecision() will return an
object containing the decision and its explanation, and getMoveDecision()
will return an object for which MoveDecision.isDecisionTaken() returns
false. If the shard is in the started state, then getMoveDecision()
will return an object containing the decision to move/rebalance the shard, and
getAllocateDecision() will return an object for which
AllocateUnassignedDecision.isDecisionTaken() returns false. If
the shard is neither unassigned nor started (i.e. it is initializing or relocating),
then both getAllocateDecision() and getMoveDecision() will return
objects whose isDecisionTaken() method returns false.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field and Description |
|---|---|
static ShardAllocationDecision |
NOT_TAKEN |
EMPTY_PARAMS| Constructor and Description |
|---|
ShardAllocationDecision(AllocateUnassignedDecision allocateDecision,
MoveDecision moveDecision) |
ShardAllocationDecision(StreamInput in) |
| Modifier and Type | Method and Description |
|---|---|
AllocateUnassignedDecision |
getAllocateDecision()
Gets the unassigned allocation decision for the shard.
|
MoveDecision |
getMoveDecision()
Gets the move decision for the shard.
|
boolean |
isDecisionTaken()
Returns
true if either an allocation decision or a move decision was taken
for the shard. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisFragmentpublic static final ShardAllocationDecision NOT_TAKEN
public ShardAllocationDecision(AllocateUnassignedDecision allocateDecision, MoveDecision moveDecision)
public ShardAllocationDecision(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
Writeablepublic boolean isDecisionTaken()
true if either an allocation decision or a move decision was taken
for the shard. If no decision was taken, as in the case of initializing or relocating
shards, then this method returns false.public AllocateUnassignedDecision getAllocateDecision()
AllocateUnassignedDecision that is returned will have AllocateUnassignedDecision.isDecisionTaken()
return false.public MoveDecision getMoveDecision()
MoveDecision that is returned will have MoveDecision.isDecisionTaken()
return false.public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOException