public final class ClusterAllocationExplanation extends java.lang.Object implements ToXContent, Writeable<ClusterAllocationExplanation>
ClusterAllocationExplanation
is an explanation of why a shard may or may not be allocated to nodes. It also includes weights
for where the shard is likely to be assigned. It is an immutable classToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<R>
EMPTY_PARAMS
Constructor and Description |
---|
ClusterAllocationExplanation(ShardId shard,
boolean primary,
java.lang.String assignedNodeId,
UnassignedInfo unassignedInfo,
java.util.Map<DiscoveryNode,Decision> nodeToDecision,
java.util.Map<DiscoveryNode,java.lang.Float> nodeWeights) |
ClusterAllocationExplanation(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAssignedNodeId()
Return the assigned node id or null if not assigned
|
java.util.Map<DiscoveryNode,Decision> |
getNodeDecisions()
Return a map of node to decision for shard allocation
|
java.util.Map<DiscoveryNode,java.lang.Float> |
getNodeWeights()
Return a map of node to balancer "weight" for allocation.
|
ShardId |
getShard() |
UnassignedInfo |
getUnassignedInfo()
Return the unassigned info for the shard or null if the shard is assigned
|
boolean |
isAssigned()
Return turn if the shard is assigned to a node
|
boolean |
isPrimary() |
ClusterAllocationExplanation |
readFrom(StreamInput in)
Reads an object of this type from the provided StreamInput.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public ClusterAllocationExplanation(StreamInput in) throws java.io.IOException
java.io.IOException
public ClusterAllocationExplanation(ShardId shard, boolean primary, @Nullable java.lang.String assignedNodeId, UnassignedInfo unassignedInfo, java.util.Map<DiscoveryNode,Decision> nodeToDecision, java.util.Map<DiscoveryNode,java.lang.Float> nodeWeights)
public ShardId getShard()
public boolean isPrimary()
public boolean isAssigned()
@Nullable public java.lang.String getAssignedNodeId()
@Nullable public UnassignedInfo getUnassignedInfo()
public java.util.Map<DiscoveryNode,Decision> getNodeDecisions()
public java.util.Map<DiscoveryNode,java.lang.Float> getNodeWeights()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public ClusterAllocationExplanation readFrom(StreamInput in) throws java.io.IOException
StreamableReader
readFrom
in interface StreamableReader<ClusterAllocationExplanation>
readFrom
in interface Writeable<ClusterAllocationExplanation>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
writeTo
in interface Writeable<ClusterAllocationExplanation>
java.io.IOException