mirror of https://github.com/apache/kafka.git
MINOR: LogCleaner.validateReconfiguration fixes (#4770)
Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
This commit is contained in:
parent
964693e40d
commit
281dbfd981
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue