Class NodeAllocationResult
java.lang.Object
org.elasticsearch.cluster.routing.allocation.NodeAllocationResult
- All Implemented Interfaces:
java.lang.Comparable<NodeAllocationResult>
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
public class NodeAllocationResult extends java.lang.Object implements org.elasticsearch.common.xcontent.ToXContentObject, Writeable, java.lang.Comparable<NodeAllocationResult>
This class represents the shard allocation decision and its explanation for a single node.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeAllocationResult.ShardStoreInfo
A class that captures metadata about a shard store on a node.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.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 NodeAllocationResult(DiscoveryNode node, AllocationDecision nodeDecision, Decision canAllocate, int weightRanking)
NodeAllocationResult(DiscoveryNode node, Decision decision, int weightRanking)
NodeAllocationResult(DiscoveryNode node, NodeAllocationResult.ShardStoreInfo shardStoreInfo, Decision decision)
NodeAllocationResult(StreamInput in)
-
Method Summary
Modifier and Type Method Description int
compareTo(NodeAllocationResult other)
Decision
getCanAllocateDecision()
The decision details for allocating to this node.DiscoveryNode
getNode()
Get the node that this decision is for.AllocationDecision
getNodeDecision()
Gets theAllocationDecision
for allocating to this node.NodeAllocationResult.ShardStoreInfo
getShardStoreInfo()
Get the shard store information for the node, if it exists.int
getWeightRanking()
The weight ranking for allocating a shard to the node.boolean
isWeightRanked()
Is the weight assigned for the node?org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.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 Details
-
NodeAllocationResult
public NodeAllocationResult(DiscoveryNode node, NodeAllocationResult.ShardStoreInfo shardStoreInfo, @Nullable Decision decision) -
NodeAllocationResult
public NodeAllocationResult(DiscoveryNode node, AllocationDecision nodeDecision, Decision canAllocate, int weightRanking) -
NodeAllocationResult
-
NodeAllocationResult
- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
getNode
Get the node that this decision is for. -
getShardStoreInfo
Get the shard store information for the node, if it exists. -
getCanAllocateDecision
The decision details for allocating to this node. Returnsnull
if no allocation decision was taken on the node; in this case,getNodeDecision()
will returnAllocationDecision.NO
. -
isWeightRanked
public boolean isWeightRanked()Is the weight assigned for the node? -
getWeightRanking
public int getWeightRanking()The weight ranking for allocating a shard to the node. Each node will have a unique weight ranking that is relative to the other nodes against which the deciders ran. For example, suppose there are 3 nodes which the allocation deciders decided upon: node1, node2, and node3. If node2 had the best weight for holding the shard, followed by node3, followed by node1, then node2's weight will be 1, node3's weight will be 2, and node1's weight will be 1. A value of 0 means the weight was not calculated or factored into the decision. -
getNodeDecision
Gets theAllocationDecision
for allocating to this node. -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<NodeAllocationResult>
-