Writeable, ToXContent, ToXContentObjectpublic final class ClusterAllocationExplanation extends java.lang.Object implements ToXContentObject, 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.ParamsWriteable.Reader<V>, Writeable.Writer<V>EMPTY_PARAMS| Constructor | Description |
|---|---|
ClusterAllocationExplanation(ShardRouting shardRouting,
DiscoveryNode currentNode,
DiscoveryNode relocationTargetNode,
ClusterInfo clusterInfo,
ShardAllocationDecision shardAllocationDecision) |
|
ClusterAllocationExplanation(StreamInput in) |
| Modifier and Type | Method | 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, waitisFragmentpublic ClusterAllocationExplanation(ShardRouting shardRouting, @Nullable DiscoveryNode currentNode, @Nullable DiscoveryNode relocationTargetNode, @Nullable ClusterInfo clusterInfo, ShardAllocationDecision shardAllocationDecision)
public ClusterAllocationExplanation(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
Writeablepublic 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 ToXContentjava.io.IOException