public final class ClusterAllocationExplanation extends java.lang.Object implements ToXContent, Writeable
ClusterAllocationExplanation
is an explanation of why a shard is unassigned,
or if it is not unassigned, then which nodes it could possibly be relocated to.
It is an immutable class.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Constructor and Description |
---|
ClusterAllocationExplanation(ShardRouting shardRouting,
DiscoveryNode currentNode,
DiscoveryNode relocationTargetNode,
ClusterInfo clusterInfo,
ShardAllocationDecision shardAllocationDecision) |
ClusterAllocationExplanation(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
ClusterInfo |
getClusterInfo()
Returns the cluster disk info for the cluster, or
null if none available. |
DiscoveryNode |
getCurrentNode()
Returns the currently assigned node, or
null if the shard is unassigned. |
DiscoveryNode |
getRelocationTargetNode()
Returns the relocating target node, or
null if the shard is not in the ShardRoutingState.RELOCATING state. |
ShardId |
getShard()
Returns the shard that the explanation is about.
|
ShardAllocationDecision |
getShardAllocationDecision()
\
Returns the shard allocation decision for attempting to assign or move the shard.
|
ShardRoutingState |
getShardState()
Returns the current
ShardRoutingState of the shard. |
UnassignedInfo |
getUnassignedInfo()
Returns the unassigned info for the shard, or
null if the shard is active. |
boolean |
isPrimary()
Returns
true if the explained shard is primary, false otherwise. |
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, wait
isFragment
public ClusterAllocationExplanation(ShardRouting shardRouting, @Nullable DiscoveryNode currentNode, @Nullable DiscoveryNode relocationTargetNode, @Nullable ClusterInfo clusterInfo, ShardAllocationDecision shardAllocationDecision)
public ClusterAllocationExplanation(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public ShardId getShard()
public boolean isPrimary()
true
if the explained shard is primary, false
otherwise.public ShardRoutingState getShardState()
ShardRoutingState
of the shard.@Nullable public DiscoveryNode getCurrentNode()
null
if the shard is unassigned.@Nullable public DiscoveryNode getRelocationTargetNode()
null
if the shard is not in the ShardRoutingState.RELOCATING
state.@Nullable public UnassignedInfo getUnassignedInfo()
null
if the shard is active.@Nullable public ClusterInfo getClusterInfo()
null
if none available.public ShardAllocationDecision getShardAllocationDecision()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException