Class FilterAllocationDecider
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- org.elasticsearch.cluster.routing.allocation.decider.FilterAllocationDecider
-
public class FilterAllocationDecider extends AllocationDecider
ThisAllocationDecider
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 (
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: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.required
- filters required allocations. If anyrequired
filters are set the allocation is denied if the index is not in the set ofrequired
to allocate on the filtered nodeinclude
- filters "allowed" allocations. If anyinclude
filters are set the allocation is denied if the index is not in the set ofinclude
filters for the filtered nodeexclude
- filters "prohibited" allocations. If anyexclude
filters are set the allocation is denied if the index is in the set ofexclude
filters for the filtered node
-
-
Field Summary
Fields Modifier and Type Field Description static Setting.AffixSetting<java.lang.String>
CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING
static Setting.AffixSetting<java.lang.String>
CLUSTER_ROUTING_INCLUDE_GROUP_SETTING
static Setting.AffixSetting<java.lang.String>
CLUSTER_ROUTING_REQUIRE_GROUP_SETTING
static java.lang.String
NAME
-
Constructor Summary
Constructors Constructor Description FilterAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
Method Summary
Modifier and Type Method Description Decision
canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated at all at this state of theRoutingAllocation
.Decision
canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be allocated on the given node.Decision
canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Returns aDecision
whether the given shard routing can be remain on the given node.-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canForceAllocatePrimary, canRebalance, canRebalance
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CLUSTER_ROUTING_REQUIRE_GROUP_SETTING
public static final Setting.AffixSetting<java.lang.String> CLUSTER_ROUTING_REQUIRE_GROUP_SETTING
-
CLUSTER_ROUTING_INCLUDE_GROUP_SETTING
public static final Setting.AffixSetting<java.lang.String> CLUSTER_ROUTING_INCLUDE_GROUP_SETTING
-
CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING
public static final Setting.AffixSetting<java.lang.String> CLUSTER_ROUTING_EXCLUDE_GROUP_SETTING
-
-
Constructor Detail
-
FilterAllocationDecider
public FilterAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
-
Method Detail
-
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
public Decision canAllocate(IndexMetaData indexMetaData, RoutingNode node, RoutingAllocation allocation)
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
-
canRemain
public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
Description copied from class:AllocationDecider
Returns aDecision
whether the given shard routing can be remain on the given node. The default isDecision.ALWAYS
.- Overrides:
canRemain
in classAllocationDecider
-
-