public class EnableAllocationDecider extends AllocationDecider implements NodeSettingsService.Listener
CLUSTER_ROUTING_ALLOCATION_ENABLE /
CLUSTER_ROUTING_REBALANCE_ENABLE and the per index setting INDEX_ROUTING_ALLOCATION_ENABLE / INDEX_ROUTING_REBALANCE_ENABLE.
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 and Description |
|---|---|
static class |
EnableAllocationDecider.Allocation
Allocation values or rather their string representation to be used used with
CLUSTER_ROUTING_ALLOCATION_ENABLE / INDEX_ROUTING_ALLOCATION_ENABLE
via cluster / index settings. |
static class |
EnableAllocationDecider.Rebalance
Rebalance values or rather their string representation to be used used with
CLUSTER_ROUTING_REBALANCE_ENABLE / INDEX_ROUTING_REBALANCE_ENABLE
via cluster / index settings. |
| Modifier and Type | Field and Description |
|---|---|
static String |
CLUSTER_ROUTING_ALLOCATION_ENABLE |
static String |
CLUSTER_ROUTING_REBALANCE_ENABLE |
static String |
INDEX_ROUTING_ALLOCATION_ENABLE |
static String |
INDEX_ROUTING_REBALANCE_ENABLE |
static String |
NAME |
deprecationLogger, logger, settings| Constructor and Description |
|---|
EnableAllocationDecider(Settings settings,
NodeSettingsService nodeSettingsService) |
| Modifier and Type | Method and 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 |
onRefreshSettings(Settings settings) |
canAllocate, canAllocate, canAllocate, canRebalance, canRemainlogDeprecatedSetting, logRemovedSetting, nodeNamepublic static final String NAME
public static final String CLUSTER_ROUTING_ALLOCATION_ENABLE
public static final String INDEX_ROUTING_ALLOCATION_ENABLE
public static final String CLUSTER_ROUTING_REBALANCE_ENABLE
public static final String INDEX_ROUTING_REBALANCE_ENABLE
@Inject public EnableAllocationDecider(Settings settings, NodeSettingsService nodeSettingsService)
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 AllocationDeciderpublic void onRefreshSettings(Settings settings)
onRefreshSettings in interface NodeSettingsService.ListenerCopyright © 2009–2016. All rights reserved.