mirror of https://github.com/apache/druid.git
Allow user to set cost balancer threads more than or equal to the number of cores. (#2964)
* Allow user to set cost balancer threads more than the number of cores. Allow user to set cost balancer threads more than the number of cores. * modify test
This commit is contained in:
parent
d3e9c47a5f
commit
a9b721a01b
|
@ -57,10 +57,7 @@ public class CoordinatorDynamicConfig
|
|||
this.replicantLifetime = replicantLifetime;
|
||||
this.replicationThrottleLimit = replicationThrottleLimit;
|
||||
this.emitBalancingStats = emitBalancingStats;
|
||||
this.balancerComputeThreads = Math.min(
|
||||
Math.max(balancerComputeThreads, 1),
|
||||
Math.max(Runtime.getRuntime().availableProcessors() - 1, 1)
|
||||
);
|
||||
this.balancerComputeThreads = Math.max(balancerComputeThreads, 1);
|
||||
this.killDataSourceWhitelist = killDataSourceWhitelist;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ public class CoordinatorDynamicConfigTest
|
|||
+ " \"maxSegmentsToMove\": 1,\n"
|
||||
+ " \"replicantLifetime\": 1,\n"
|
||||
+ " \"replicationThrottleLimit\": 1,\n"
|
||||
+ " \"balancerComputeThreads\": 2, \n"
|
||||
+ " \"emitBalancingStats\": true,\n"
|
||||
+ " \"killDataSourceWhitelist\": [\"test\"]\n"
|
||||
+ "}\n";
|
||||
|
@ -56,7 +57,7 @@ public class CoordinatorDynamicConfigTest
|
|||
);
|
||||
|
||||
Assert.assertEquals(
|
||||
new CoordinatorDynamicConfig(1, 1, 1, 1, 1, 1, 1, true, ImmutableSet.of("test")),
|
||||
new CoordinatorDynamicConfig(1, 1, 1, 1, 1, 1, 2, true, ImmutableSet.of("test")),
|
||||
actual
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue