Class AllocationDeciders
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders
-
public class AllocationDeciders extends AllocationDecider
A compositeAllocationDecider
combining the "decision" of multipleAllocationDecider
implementations into a single allocation decision.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Constructor Description AllocationDeciders(Settings settings, java.util.Collection<AllocationDecider> allocations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Decision
canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
.Decision
canAllocate(RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given node can allow any allocation at all at this state of theRoutingAllocation
.Decision
canAllocate(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
.Decision
canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated on the given node.Decision
canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given primary shard can be forcibly allocated on the given node.Decision
canRebalance(RoutingAllocation allocation)
Returns aDecision
whether the cluster can execute re-balanced operations at all.Decision
canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be re-balanced to the given allocation.Decision
canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be remain on the given node.-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
-
-
-
Constructor Detail
-
AllocationDeciders
public AllocationDeciders(Settings settings, java.util.Collection<AllocationDecider> allocations)
-
-
Method Detail
-
canRebalance
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be re-balanced to the given allocation. The default isDecision.ALWAYS
.- Overrides:
canRebalance
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
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be remain on the given node. The default isDecision.ALWAYS
.- Overrides:
canRemain
in classAllocationDecider
-
canAllocate
public Decision canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
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, RoutingAllocation allocation)
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(RoutingNode node, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given node can allow any allocation at all at this state of theRoutingAllocation
. The default isDecision.ALWAYS
.- Overrides:
canAllocate
in classAllocationDecider
-
canRebalance
public Decision canRebalance(RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the cluster can execute re-balanced operations at all.Decision.ALWAYS
.- Overrides:
canRebalance
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
-
-