Class NodeAllocationResult
java.lang.Object
org.elasticsearch.cluster.routing.allocation.NodeAllocationResult
- All Implemented Interfaces:
Comparable<NodeAllocationResult>
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
public class NodeAllocationResult
extends Object
implements org.elasticsearch.common.xcontent.ToXContentObject, Writeable, Comparable<NodeAllocationResult>
This class represents the shard allocation decision and its explanation for a single node.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
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
ConstructorDescriptionNodeAllocationResult(DiscoveryNode node, AllocationDecision nodeDecision, Decision canAllocate, int weightRanking)
NodeAllocationResult(DiscoveryNode node, Decision decision, int weightRanking)
NodeAllocationResult(DiscoveryNode node, NodeAllocationResult.ShardStoreInfo shardStoreInfo, Decision decision)
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo(NodeAllocationResult other)
The decision details for allocating to this node.getNode()
Get the node that this decision is for.Gets theAllocationDecision
for allocating to this node.Get the shard store information for the node, if it exists.int
The weight ranking for allocating a shard to the node.boolean
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:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
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 IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
compareTo
- Specified by:
compareTo
in interfaceComparable<NodeAllocationResult>
-