Class EnableAllocationDecider
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider
-
public class EnableAllocationDecider extends AllocationDecider
This allocation decider allows shard allocations / rebalancing via the cluster wide settingsCLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING/CLUSTER_ROUTING_REBALANCE_ENABLE_SETTINGand the per index settingINDEX_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
Nested Classes Modifier and Type Class Description static classEnableAllocationDecider.AllocationAllocation values or rather their string representation to be used used withCLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING/INDEX_ROUTING_ALLOCATION_ENABLE_SETTINGvia cluster / index settings.static classEnableAllocationDecider.RebalanceRebalance values or rather their string representation to be used used withCLUSTER_ROUTING_REBALANCE_ENABLE_SETTING/INDEX_ROUTING_REBALANCE_ENABLE_SETTINGvia cluster / index settings.
-
Field Summary
Fields Modifier and Type Field Description static Setting<EnableAllocationDecider.Allocation>CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTINGstatic Setting<EnableAllocationDecider.Rebalance>CLUSTER_ROUTING_REBALANCE_ENABLE_SETTINGstatic Setting<EnableAllocationDecider.Allocation>INDEX_ROUTING_ALLOCATION_ENABLE_SETTINGstatic Setting<EnableAllocationDecider.Rebalance>INDEX_ROUTING_REBALANCE_ENABLE_SETTINGstatic java.lang.StringNAME
-
Constructor Summary
Constructors Constructor Description EnableAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
Method Summary
Modifier and Type Method Description DecisioncanAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be allocated on the given node.DecisioncanRebalance(ShardRouting shardRouting, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be re-balanced to the given allocation.voidsetEnableAllocation(EnableAllocationDecider.Allocation enableAllocation)voidsetEnableRebalance(EnableAllocationDecider.Rebalance enableRebalance)-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRemain
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String 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 Detail
-
EnableAllocationDecider
public EnableAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
-
Method Detail
-
setEnableRebalance
public void setEnableRebalance(EnableAllocationDecider.Rebalance enableRebalance)
-
setEnableAllocation
public void setEnableAllocation(EnableAllocationDecider.Allocation enableAllocation)
-
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
-
canRebalance
public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
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
-
-