public final class ClusterAllocationExplanation extends java.lang.Object implements ToXContent, Writeable
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 classModifier and Type | Class and Description |
---|---|
static class |
ClusterAllocationExplanation.FinalDecision
An Enum representing the final decision for a shard allocation on a node
|
static class |
ClusterAllocationExplanation.StoreCopy
An Enum representing the state of the shard store's copy of the data on a node
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Constructor and Description |
---|
ClusterAllocationExplanation(ShardId shard,
boolean primary,
java.lang.String assignedNodeId,
long allocationDelayMillis,
long remainingDelayMillis,
UnassignedInfo unassignedInfo,
boolean hasPendingAsyncFetch,
java.util.Map<DiscoveryNode,NodeExplanation> nodeExplanations,
ClusterInfo clusterInfo) |
ClusterAllocationExplanation(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
long |
getAllocationDelayMillis()
Return the configured delay before the shard can be allocated in milliseconds
|
java.lang.String |
getAssignedNodeId()
Return the assigned node id or null if not assigned
|
ClusterInfo |
getClusterInfo()
Return the cluster disk info for the cluster or null if none available
|
java.util.Map<DiscoveryNode,NodeExplanation> |
getNodeExplanations()
Return a map of node to the explanation for that node
|
long |
getRemainingDelayMillis()
Return the remaining allocation delay for this shard in milliseconds
|
ShardId |
getShard()
Return the shard that the explanation is about
|
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()
Return true if the explained shard is primary, false otherwise
|
boolean |
isStillFetchingShardData()
Return turn if shard data is still being fetched for the allocation
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public ClusterAllocationExplanation(ShardId shard, boolean primary, @Nullable java.lang.String assignedNodeId, long allocationDelayMillis, long remainingDelayMillis, @Nullable UnassignedInfo unassignedInfo, boolean hasPendingAsyncFetch, java.util.Map<DiscoveryNode,NodeExplanation> nodeExplanations, @Nullable ClusterInfo clusterInfo)
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()
public boolean isStillFetchingShardData()
public boolean isAssigned()
@Nullable public java.lang.String getAssignedNodeId()
@Nullable public UnassignedInfo getUnassignedInfo()
public long getAllocationDelayMillis()
public long getRemainingDelayMillis()
public java.util.Map<DiscoveryNode,NodeExplanation> getNodeExplanations()
@Nullable public ClusterInfo getClusterInfo()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException