From fca3adcd59d9665b37df6b6f57d2ab137616323b Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sun, 25 Sep 2011 21:09:41 +0300 Subject: [PATCH] allow to dynamically set cluster.routing.allocation.cluster_concurrent_rebalance using cluster update settings API --- .../decider/ConcurrentRebalanceAllocationDecider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java index ff76f686459..1a9bb313b35 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java @@ -49,10 +49,11 @@ public class ConcurrentRebalanceAllocationDecider extends AllocationDecider { private volatile int clusterConcurrentRebalance; - @Inject public ConcurrentRebalanceAllocationDecider(Settings settings) { + @Inject public ConcurrentRebalanceAllocationDecider(Settings settings, NodeSettingsService nodeSettingsService) { super(settings); this.clusterConcurrentRebalance = settings.getAsInt("cluster.routing.allocation.cluster_concurrent_rebalance", 2); logger.debug("using [cluster_concurrent_rebalance] with [{}]", clusterConcurrentRebalance); + nodeSettingsService.addListener(new ApplySettings()); } @Override public boolean canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) {