MINOR: LogCleaner.validateReconfiguration fixes (#4770)

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
This commit is contained in:
Ismael Juma 2018-03-27 21:03:35 -07:00 committed by GitHub
parent 964693e40d
commit 281dbfd981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -161,9 +161,8 @@ class LogCleaner(initialConfig: CleanerConfig,
override def validateReconfiguration(newConfig: KafkaConfig): Unit = {
val newCleanerConfig = LogCleaner.cleanerConfig(newConfig)
val numThreads = newCleanerConfig.numThreads
numThreads >= 1 && numThreads >= config.numThreads / 2 && numThreads <= config.numThreads * 2
val currentThreads = config.numThreads
if (numThreads <= 0)
if (numThreads < 1)
throw new ConfigException(s"Log cleaner threads should be at least 1")
if (numThreads < currentThreads / 2)
throw new ConfigException(s"Log cleaner threads cannot be reduced to less than half the current value $currentThreads")