Class AllocationDecider
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- Direct Known Subclasses:
AllocationDeciders,AwarenessAllocationDecider,ClusterRebalanceAllocationDecider,ConcurrentRebalanceAllocationDecider,DiskThresholdDecider,EnableAllocationDecider,FilterAllocationDecider,MaxRetryAllocationDecider,NodeVersionAllocationDecider,RebalanceOnlyWhenActiveAllocationDecider,ReplicaAfterPrimaryActiveAllocationDecider,ResizeAllocationDecider,RestoreInProgressAllocationDecider,SameShardAllocationDecider,ShardsLimitAllocationDecider,SnapshotInProgressAllocationDecider,ThrottlingAllocationDecider
public abstract class AllocationDecider extends java.lang.ObjectAllocationDecideris an abstract base class that allows to make dynamic cluster- or index-wide shard allocation decisions on a per-node basis.
-
-
Constructor Summary
Constructors Constructor Description AllocationDecider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecisioncanAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation.DecisioncanAllocate(RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given node can allow any allocation at all at this state of theRoutingAllocation.DecisioncanAllocate(ShardRouting shardRouting, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation.DecisioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be allocated on the given node.DecisioncanForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given primary shard can be forcibly allocated on the given node.DecisioncanRebalance(RoutingAllocation allocation)Returns aDecisionwhether the cluster can execute re-balanced operations at all.DecisioncanRebalance(ShardRouting shardRouting, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be re-balanced to the given allocation.DecisioncanRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be remain on the given node.
-
-
-
Method Detail
-
canRebalance
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecisionwhether the given shard routing can be re-balanced to the given allocation. The default isDecision.ALWAYS.
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecisionwhether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS.
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecisionwhether the given shard routing can be remain on the given node. The default isDecision.ALWAYS.
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation. The default isDecision.ALWAYS.
-
canAllocate
public Decision canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation. The default isDecision.ALWAYS.
-
canAllocate
public Decision canAllocate(RoutingNode node, RoutingAllocation allocation)
Returns aDecisionwhether the given node can allow any allocation at all at this state of theRoutingAllocation. The default isDecision.ALWAYS.
-
canRebalance
public Decision canRebalance(RoutingAllocation allocation)
Returns aDecisionwhether the cluster can execute re-balanced operations at all.Decision.ALWAYS.
-
canForceAllocatePrimary
public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecisionwhether the given primary shard can be forcibly allocated on the given node. This method should only be called for unassigned primary shards where the node has a shard copy on disk. Note: all implementations that override this behavior should take into account the results ofcanAllocate(ShardRouting, RoutingNode, RoutingAllocation)before making a decision on force allocation, because force allocation should only be considered if all deciders returnDecision.NO.
-
-