Class ClusterAllocationExplanation
java.lang.Object
org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplanation
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public final class ClusterAllocationExplanation extends java.lang.Object implements ToXContentObject, Writeable
A
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
-
Constructor Summary
Constructors Constructor Description ClusterAllocationExplanation(ShardRouting shardRouting, DiscoveryNode currentNode, DiscoveryNode relocationTargetNode, ClusterInfo clusterInfo, ShardAllocationDecision shardAllocationDecision)ClusterAllocationExplanation(StreamInput in) -
Method Summary
Modifier and Type Method Description ClusterInfogetClusterInfo()Returns the cluster disk info for the cluster, ornullif none available.DiscoveryNodegetCurrentNode()Returns the currently assigned node, ornullif the shard is unassigned.DiscoveryNodegetRelocationTargetNode()Returns the relocating target node, ornullif the shard is not in theShardRoutingState.RELOCATINGstate.ShardIdgetShard()Returns the shard that the explanation is about.ShardAllocationDecisiongetShardAllocationDecision()Returns the shard allocation decision for attempting to assign or move the shard.ShardRoutingStategetShardState()Returns the currentShardRoutingStateof the shard.UnassignedInfogetUnassignedInfo()Returns the unassigned info for the shard, ornullif the shard is active.booleanisPrimary()Returnstrueif the explained shard is primary,falseotherwise.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.
-
Constructor Details
-
ClusterAllocationExplanation
public ClusterAllocationExplanation(ShardRouting shardRouting, @Nullable DiscoveryNode currentNode, @Nullable DiscoveryNode relocationTargetNode, @Nullable ClusterInfo clusterInfo, ShardAllocationDecision shardAllocationDecision) -
ClusterAllocationExplanation
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
getShard
Returns the shard that the explanation is about. -
isPrimary
public boolean isPrimary()Returnstrueif the explained shard is primary,falseotherwise. -
getShardState
Returns the currentShardRoutingStateof the shard. -
getCurrentNode
Returns the currently assigned node, ornullif the shard is unassigned. -
getRelocationTargetNode
Returns the relocating target node, ornullif the shard is not in theShardRoutingState.RELOCATINGstate. -
getUnassignedInfo
Returns the unassigned info for the shard, ornullif the shard is active. -
getClusterInfo
Returns the cluster disk info for the cluster, ornullif none available. -
getShardAllocationDecision
Returns the shard allocation decision for attempting to assign or move the shard. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-