Class AllocationDeciders
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders
A composite
AllocationDecider combining the "decision" of multiple
AllocationDecider implementations into a single allocation decision.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanAllocate(IndexMetadata indexMetadata, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation.canAllocate(ShardRouting shardRouting, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation.canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be allocated on the given node.canAllocateReplicaWhenThereIsRetentionLease(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given replica shard can be allocated to the given node when there is an existing retention lease already existing on the node (meaning it has been allocated there previously) This method does not actually check whether there is a retention lease, that is the responsibility of the caller.canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether 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 aDecisionwhether the given primary shard can be forcibly allocated on the given node.canRebalance(RoutingAllocation allocation) Returns aDecisionwhether the cluster can execute re-balanced operations at all.canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be re-balanced to the given allocation.canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Returns aDecisionwhether the given shard routing can be remain on the given node.shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) Returns aDecisionwhether shards of the given index should be auto-expanded to this node at this state of theRoutingAllocation.
-
Constructor Details
-
AllocationDeciders
-
-
Method Details
-
canRebalance
Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be re-balanced to the given allocation. The default isDecision.ALWAYS.- Overrides:
canRebalancein classAllocationDecider
-
canAllocate
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be allocated on the given node. The default isDecision.ALWAYS.- Overrides:
canAllocatein classAllocationDecider
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be remain on the given node. The default isDecision.ALWAYS.- Overrides:
canRemainin classAllocationDecider
-
canAllocate
public Decision canAllocate(IndexMetadata indexMetadata, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation. The default isDecision.ALWAYS.- Overrides:
canAllocatein classAllocationDecider
-
shouldAutoExpandToNode
public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether shards of the given index should be auto-expanded to this node at this state of theRoutingAllocation. The default isDecision.ALWAYS.- Overrides:
shouldAutoExpandToNodein classAllocationDecider
-
canAllocate
Description copied from class:AllocationDeciderReturns aDecisionwhether the given shard routing can be allocated at all at this state of theRoutingAllocation. The default isDecision.ALWAYS.- Overrides:
canAllocatein classAllocationDecider
-
canRebalance
Description copied from class:AllocationDeciderReturns aDecisionwhether the cluster can execute re-balanced operations at all.Decision.ALWAYS.- Overrides:
canRebalancein classAllocationDecider
-
canForceAllocatePrimary
public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns 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 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:
canForceAllocatePrimaryin classAllocationDecider
-
canForceAllocateDuringReplace
public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether 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:
canForceAllocateDuringReplacein classAllocationDecider
-
canAllocateReplicaWhenThereIsRetentionLease
public Decision canAllocateReplicaWhenThereIsRetentionLease(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) Description copied from class:AllocationDeciderReturns aDecisionwhether the given replica shard can be allocated to the given node when there is an existing retention lease already existing on the node (meaning it has been allocated there previously) This method does not actually check whether there is a retention lease, that is the responsibility of the caller. It defaults to the same value ascanAllocate.- Overrides:
canAllocateReplicaWhenThereIsRetentionLeasein classAllocationDecider
-