public class FilterAllocationDecider extends AllocationDecider
AllocationDecider
control shard allocation by include and
exclude filters via dynamic cluster and index routing settings.
This filter is used to make explicit decision on which nodes certain shard can / should be allocated. The decision if a shard can be allocated, must not be allocated or should be allocated is based on either cluster wide dynamic settings (cluster.routing.allocation.*) or index specific dynamic settings (index.routing.allocation.*). All of those settings can be changed at runtime via the cluster or the index update settings API.
Note: Cluster settings are applied first and will override index specific settings such that if a shard can be allocated according to the index routing settings it wont be allocated on a node if the cluster specific settings would disallow the allocation. Filters are applied in the following order:Modifier and Type | Field and Description |
---|---|
static Setting<Settings> |
CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING |
static Setting<Settings> |
CLUSTER_ROUTING_INCLUDE_GROUP_SETTING |
static Setting<Settings> |
CLUSTER_ROUTING_REQUIRE_GROUP_SETTING |
static java.lang.String |
NAME |
deprecationLogger, logger, settings
Constructor and Description |
---|
FilterAllocationDecider(Settings settings,
ClusterSettings clusterSettings) |
Modifier and Type | Method and Description |
---|---|
Decision |
canAllocate(IndexMetaData indexMetaData,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be allocated at all at this state of the
RoutingAllocation . |
Decision |
canAllocate(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be
allocated on the given node. |
Decision |
canRemain(ShardRouting shardRouting,
RoutingNode node,
RoutingAllocation allocation)
Returns a
Decision whether the given shard routing can be remain
on the given node. |
canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalance
logDeprecatedSetting, logRemovedSetting, nodeName
public static final java.lang.String NAME
public static final Setting<Settings> CLUSTER_ROUTING_REQUIRE_GROUP_SETTING
public static final Setting<Settings> CLUSTER_ROUTING_INCLUDE_GROUP_SETTING
public FilterAllocationDecider(Settings settings, ClusterSettings clusterSettings)
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given shard routing can be
allocated on the given node. The default is Decision.ALWAYS
.canAllocate
in class AllocationDecider
public Decision canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given shard routing can be allocated at all at this state of the
RoutingAllocation
. The default is Decision.ALWAYS
.canAllocate
in class AllocationDecider
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
AllocationDecider
Decision
whether the given shard routing can be remain
on the given node. The default is Decision.ALWAYS
.canRemain
in class AllocationDecider