Class ResizeAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.ResizeAllocationDecider
An allocation decider that ensures we allocate the shards of a target index for resize operations next to the source primaries
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncanAllocate
(ShardRouting shardRouting, RoutingAllocation allocation) Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
.canAllocate
(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecision
whether the given shard routing can be allocated on the given node.canForceAllocateDuringReplace
(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecision
whether the given shard can be forced to the given node in the event that the shard's source node is being replaced.canForceAllocatePrimary
(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecision
whether the given primary shard can be forcibly allocated on the given node.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocateReplicaWhenThereIsRetentionLease, canRebalance, canRebalance, canRemain, shouldAutoExpandToNode
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ResizeAllocationDecider
public ResizeAllocationDecider()
-
-
Method Details
-
canAllocate
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canForceAllocatePrimary
public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDecider
Returns aDecision
whether 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 ofAllocationDecider.canAllocate(ShardRouting, RoutingNode, RoutingAllocation)
before making a decision on force allocation, because force allocation should only be considered if all deciders returnDecision.NO
.- Overrides:
canForceAllocatePrimary
in classAllocationDecider
-
canForceAllocateDuringReplace
public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDecider
Returns aDecision
whether the given shard can be forced to the given node in the event that the shard's source node is being replaced. This allows nodes using a replace-type node shutdown to override certain deciders in the interest of moving the shard away from a node that *must* be removed. It defaults to returning "YES" and must be overridden by deciders that opt-out to having their other NO decisions *not* overridden while vacating. The caller is responsible for first checking: - that a replacement is ongoing - the shard routing's current node is the source of the replacement- Overrides:
canForceAllocateDuringReplace
in classAllocationDecider
-