public class EnableAllocationDecider extends AllocationDecider
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
| Modifier and Type | Class | Description |
|---|---|---|
static class |
EnableAllocationDecider.Allocation |
Allocation values or rather their string representation to be used used with
CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING /
INDEX_ROUTING_ALLOCATION_ENABLE_SETTING
via cluster / index settings. |
static class |
EnableAllocationDecider.Rebalance |
Rebalance values or rather their string representation to be used used with
CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING /
INDEX_ROUTING_REBALANCE_ENABLE_SETTING
via cluster / index settings. |
| Modifier and Type | Field | Description |
|---|---|---|
static Setting<EnableAllocationDecider.Allocation> |
CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING |
|
static Setting<EnableAllocationDecider.Rebalance> |
CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING |
|
static Setting<EnableAllocationDecider.Allocation> |
INDEX_ROUTING_ALLOCATION_ENABLE_SETTING |
|
static Setting<EnableAllocationDecider.Rebalance> |
INDEX_ROUTING_REBALANCE_ENABLE_SETTING |
|
static java.lang.String |
NAME |
deprecationLogger, logger, settings| Constructor | Description |
|---|---|
EnableAllocationDecider(Settings settings,
ClusterSettings clusterSettings) |
| Modifier and Type | Method | Description |
|---|---|---|
Decision |
canAllocate(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation) |
Returns a
Decision whether the given shard routing can be
allocated on the given node. |
Decision |
canRebalance(ShardRouting shardRouting,
RoutingAllocation allocation) |
Returns a
Decision whether the given shard routing can be
re-balanced to the given allocation. |
void |
setEnableAllocation(EnableAllocationDecider.Allocation enableAllocation) |
|
void |
setEnableRebalance(EnableAllocationDecider.Rebalance enableRebalance) |
logDeprecatedSetting, logRemovedSetting, nodeNamecanAllocate, canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRemainpublic static final java.lang.String NAME
public static final Setting<EnableAllocationDecider.Allocation> CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Allocation> INDEX_ROUTING_ALLOCATION_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Rebalance> CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING
public static final Setting<EnableAllocationDecider.Rebalance> INDEX_ROUTING_REBALANCE_ENABLE_SETTING
public EnableAllocationDecider(Settings settings, ClusterSettings clusterSettings)
public void setEnableRebalance(EnableAllocationDecider.Rebalance enableRebalance)
public void setEnableAllocation(EnableAllocationDecider.Allocation enableAllocation)
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDeciderDecision whether the given shard routing can be
allocated on the given node. The default is Decision.ALWAYS.canAllocate in class AllocationDeciderpublic Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
AllocationDeciderDecision whether the given shard routing can be
re-balanced to the given allocation. The default is
Decision.ALWAYS.canRebalance in class AllocationDecider