Class EnableAllocationDecider
java.lang.Object
org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider
This allocation decider allows shard allocations / rebalancing via the cluster wide settings
CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING
/ CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING
and the per index setting
INDEX_ROUTING_ALLOCATION_ENABLE_SETTING
/ INDEX_ROUTING_REBALANCE_ENABLE_SETTING
.
The per index settings overrides the cluster wide setting.
Allocation settings can have the following values (non-casesensitive):
-
NONE
- no shard allocation is allowed. -
NEW_PRIMARIES
- only primary shards of new indices are allowed to be allocated -
PRIMARIES
- only primary shards are allowed to be allocated -
ALL
- all shards are allowed to be allocated
Rebalancing settings can have the following values (non-casesensitive):
-
NONE
- no shard rebalancing is allowed. -
REPLICAS
- only replica shards are allowed to be balanced -
PRIMARIES
- only primary shards are allowed to be balanced -
ALL
- all shards are allowed to be balanced
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Allocation values or rather their string representation to be used used withCLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING
/INDEX_ROUTING_ALLOCATION_ENABLE_SETTING
via cluster / index settings.static class
Rebalance values or rather their string representation to be used used withCLUSTER_ROUTING_REBALANCE_ENABLE_SETTING
/INDEX_ROUTING_REBALANCE_ENABLE_SETTING
via cluster / index settings. -
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.canRebalance(RoutingAllocation allocation)
Returns aDecision
whether the cluster can execute re-balanced operations at all.canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be re-balanced to the given allocation.Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canForceAllocatePrimary, canRemain, shouldAutoExpandToNode
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Allocation> CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING -
INDEX_ROUTING_ALLOCATION_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Allocation> INDEX_ROUTING_ALLOCATION_ENABLE_SETTING -
CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Rebalance> CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING -
INDEX_ROUTING_REBALANCE_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Rebalance> INDEX_ROUTING_REBALANCE_ENABLE_SETTING
-
-
Constructor Details
-
EnableAllocationDecider
-
-
Method Details
-
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
-
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
-
canRebalance
Description copied from class:AllocationDecider
Returns aDecision
whether the cluster can execute re-balanced operations at all.Decision.ALWAYS
.- Overrides:
canRebalance
in classAllocationDecider
-
canRebalance
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
-