kamalcph commented on code in PR #17793:
URL: https://github.com/apache/kafka/pull/17793#discussion_r1846706144
##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -840,6 +849,42 @@ class BrokerDynamicThreadPool(server: KafkaBroker) extends
BrokerReconfigurable
}
}
+
+class RemoteLogDynamicThreadPool(server: KafkaBroker) extends
BrokerReconfigurable {
+
+ override def reconfigurableConfigs: Set[String] = Set(
+ RemoteLogManagerConfig.REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE_PROP,
+ RemoteLogManagerConfig.REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE_PROP,
+ RemoteLogManagerConfig.REMOTE_LOG_READER_THREADS_PROP)
+
+ override def validateReconfiguration(newConfig: KafkaConfig): Unit = {
+ DynamicThreadPool.validateReconfiguration(server.config, newConfig)
+ }
+
+ override def reconfigure(oldConfig: KafkaConfig, newConfig: KafkaConfig):
Unit = {
+ if (server.remoteLogManagerOpt.isEmpty) {
+ return
+ }
+
+ val remoteLogManager = server.remoteLogManagerOpt
+ if (newConfig.remoteLogCopierThreads != oldConfig.remoteLogCopierThreads) {
+ val oldValue = oldConfig.remoteLogCopierThreads
+ val newValue = newConfig.remoteLogCopierThreads
+ remoteLogManager.get.resizeCopierThreadPool(oldValue, newValue)
+ }
Review Comment:
Better to extract the remoteLogManagerConfig:
```
val remoteLogManager = server.remoteLogManagerOpt.get
val oldRLMConfig = oldConfig.remoteLogManagerConfig
val newRLMConfig = newConfig.remoteLogManagerConfig
if (oldRLMConfig.remoteLogManagerCopierThreadPoolSize() !=
newRLMConfig.remoteLogManagerCopierThreadPoolSize()) {
remoteLogManager.resizeCopierThreadPool(newRLMConfig.remoteLogManagerCopierThreadPoolSize())
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]