make sure the dynamic config has at least 1 thread

This commit is contained in:
fjy 2014-05-20 12:45:35 -07:00
parent e5454b47f1
commit 37dca4d437
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,10 @@ public class CoordinatorDynamicConfig
this.replicantLifetime = replicantLifetime;
this.replicationThrottleLimit = replicationThrottleLimit;
this.emitBalancingStats = emitBalancingStats;
this.balancerComputeThreads = Math.min(balancerComputeThreads, Runtime.getRuntime().availableProcessors() - 1);
this.balancerComputeThreads = Math.min(
Math.max(balancerComputeThreads, 1),
Runtime.getRuntime().availableProcessors() - 1
);
}
@JsonProperty