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
AClusterAllocationExplanation
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.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
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 ClusterInfo
getClusterInfo()
Returns the cluster disk info for the cluster, ornull
if none available.DiscoveryNode
getCurrentNode()
Returns the currently assigned node, ornull
if the shard is unassigned.DiscoveryNode
getRelocationTargetNode()
Returns the relocating target node, ornull
if the shard is not in theShardRoutingState.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 currentShardRoutingState
of the shard.UnassignedInfo
getUnassignedInfo()
Returns the unassigned info for the shard, ornull
if the shard is active.boolean
isPrimary()
Returnstrue
if the explained shard is primary,false
otherwise.XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Constructor Detail
-
ClusterAllocationExplanation
public ClusterAllocationExplanation(ShardRouting shardRouting, @Nullable DiscoveryNode currentNode, @Nullable DiscoveryNode relocationTargetNode, @Nullable ClusterInfo clusterInfo, ShardAllocationDecision shardAllocationDecision)
-
ClusterAllocationExplanation
public ClusterAllocationExplanation(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
getShard
public ShardId getShard()
Returns the shard that the explanation is about.
-
isPrimary
public boolean isPrimary()
Returnstrue
if the explained shard is primary,false
otherwise.
-
getShardState
public ShardRoutingState getShardState()
Returns the currentShardRoutingState
of the shard.
-
getCurrentNode
@Nullable public DiscoveryNode getCurrentNode()
Returns the currently assigned node, ornull
if the shard is unassigned.
-
getRelocationTargetNode
@Nullable public DiscoveryNode getRelocationTargetNode()
Returns the relocating target node, ornull
if the shard is not in theShardRoutingState.RELOCATING
state.
-
getUnassignedInfo
@Nullable public UnassignedInfo getUnassignedInfo()
Returns the unassigned info for the shard, ornull
if the shard is active.
-
getClusterInfo
@Nullable public ClusterInfo getClusterInfo()
Returns the cluster disk info for the cluster, ornull
if none available.
-
getShardAllocationDecision
public ShardAllocationDecision 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:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
-