Class ClusterRebalanceAllocationDecider
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
-
- org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider
-
public class ClusterRebalanceAllocationDecider extends AllocationDecider
ThisAllocationDecidercontrols re-balancing operations based on the cluster wide active shard state. This decided can not be configured in real-time and should be pre-cluster start viacluster.routing.allocation.allow_rebalance. This setting respects the following values:indices_primaries_active- Re-balancing is allowed only once all primary shards on all indices are active.indices_all_active- Re-balancing is allowed only once all shards on all indices are active.always- Re-balancing is allowed once a shard replication group is active
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusterRebalanceAllocationDecider.ClusterRebalanceTypeAn enum representation for the configured re-balance type.
-
Field Summary
Fields Modifier and Type Field Description static Setting<ClusterRebalanceAllocationDecider.ClusterRebalanceType>CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTINGstatic java.lang.StringNAME-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
-
Constructor Summary
Constructors Constructor Description ClusterRebalanceAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecisioncanRebalance(RoutingAllocation allocation)Returns aDecisionwhether the cluster can execute re-balanced operations at all.DecisioncanRebalance(ShardRouting shardRouting, RoutingAllocation allocation)Returns aDecisionwhether the given shard routing can be re-balanced to the given allocation.-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider
canAllocate, canAllocate, canAllocate, canAllocate, canForceAllocatePrimary, canRemain
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING
public static final Setting<ClusterRebalanceAllocationDecider.ClusterRebalanceType> CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING
-
-
Constructor Detail
-
ClusterRebalanceAllocationDecider
public ClusterRebalanceAllocationDecider(Settings settings, ClusterSettings clusterSettings)
-
-
Method Detail
-
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
-
canRebalance
public Decision canRebalance(RoutingAllocation allocation)
Description copied from class:AllocationDeciderReturns aDecisionwhether the cluster can execute re-balanced operations at all.Decision.ALWAYS.- Overrides:
canRebalancein classAllocationDecider
-
-