You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "clarkwtc (via GitHub)" <gi...@apache.org> on 2025/03/03 16:36:12 UTC

[PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

clarkwtc opened a new pull request, #19081:
URL: https://github.com/apache/kafka/pull/19081

   * Add `DynamicThreadPool.java` to the server module.
   * Remove the old DynamicThreadPool object in the `DynamicBrokerConfig.scala`.
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "clarkwtc (via GitHub)" <gi...@apache.org>.
clarkwtc commented on PR #19081:
URL: https://github.com/apache/kafka/pull/19081#issuecomment-2708609581

   @chia7712 
   No problem.
   I've merged it.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #19081:
URL: https://github.com/apache/kafka/pull/19081#issuecomment-2708761638

   the failed test is traced by https://issues.apache.org/jira/browse/KAFKA-18606


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #19081:
URL: https://github.com/apache/kafka/pull/19081


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #19081:
URL: https://github.com/apache/kafka/pull/19081#issuecomment-2708604833

   @clarkwtc could you please merge trunk to run CI again?


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #19081:
URL: https://github.com/apache/kafka/pull/19081#discussion_r1978706254


##########
server/src/main/java/org/apache/kafka/server/DynamicThreadPool.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server;
+
+import org.apache.kafka.common.config.ConfigException;
+import org.apache.kafka.server.config.AbstractKafkaConfig;
+import org.apache.kafka.server.config.ReplicationConfigs;
+import org.apache.kafka.server.config.ServerConfigs;
+import org.apache.kafka.server.config.ServerLogConfigs;
+
+import java.util.Set;
+
+public class DynamicThreadPool {
+    public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
+            ServerConfigs.NUM_IO_THREADS_CONFIG,
+            ReplicationConfigs.NUM_REPLICA_FETCHERS_CONFIG,
+            ServerLogConfigs.NUM_RECOVERY_THREADS_PER_DATA_DIR_CONFIG,
+            ServerConfigs.BACKGROUND_THREADS_CONFIG
+    );
+
+    private DynamicThreadPool() {}
+
+    public static void validateReconfiguration(AbstractKafkaConfig currentConfig, AbstractKafkaConfig newConfig) {
+        newConfig.values().forEach((key, value) -> {

Review Comment:
   nit: Since this is not a simple lambda, I would suggest it would be better to use enhanced for instead of `forEach`



##########
server/src/main/java/org/apache/kafka/server/DynamicThreadPool.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server;
+
+import org.apache.kafka.common.config.ConfigException;
+import org.apache.kafka.server.config.AbstractKafkaConfig;
+import org.apache.kafka.server.config.ReplicationConfigs;
+import org.apache.kafka.server.config.ServerConfigs;
+import org.apache.kafka.server.config.ServerLogConfigs;
+
+import java.util.Set;
+
+public class DynamicThreadPool {
+    public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
+            ServerConfigs.NUM_IO_THREADS_CONFIG,

Review Comment:
   nit: indentation. It seems there is an extra tab here.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "clarkwtc (via GitHub)" <gi...@apache.org>.
clarkwtc commented on code in PR #19081:
URL: https://github.com/apache/kafka/pull/19081#discussion_r1979704994


##########
server/src/main/java/org/apache/kafka/server/DynamicThreadPool.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server;
+
+import org.apache.kafka.common.config.ConfigException;
+import org.apache.kafka.server.config.AbstractKafkaConfig;
+import org.apache.kafka.server.config.ReplicationConfigs;
+import org.apache.kafka.server.config.ServerConfigs;
+import org.apache.kafka.server.config.ServerLogConfigs;
+
+import java.util.Set;
+
+public class DynamicThreadPool {
+    public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
+            ServerConfigs.NUM_IO_THREADS_CONFIG,
+            ReplicationConfigs.NUM_REPLICA_FETCHERS_CONFIG,
+            ServerLogConfigs.NUM_RECOVERY_THREADS_PER_DATA_DIR_CONFIG,
+            ServerConfigs.BACKGROUND_THREADS_CONFIG
+    );
+
+    private DynamicThreadPool() {}
+
+    public static void validateReconfiguration(AbstractKafkaConfig currentConfig, AbstractKafkaConfig newConfig) {
+        newConfig.values().forEach((key, value) -> {

Review Comment:
   You're right.
   Use `stream.forEach` for simple lambda expressions.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18909: Move DynamicThreadPool to server module [kafka]

Posted by "clarkwtc (via GitHub)" <gi...@apache.org>.
clarkwtc commented on code in PR #19081:
URL: https://github.com/apache/kafka/pull/19081#discussion_r1979707246


##########
server/src/main/java/org/apache/kafka/server/DynamicThreadPool.java:
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server;
+
+import org.apache.kafka.common.config.ConfigException;
+import org.apache.kafka.server.config.AbstractKafkaConfig;
+import org.apache.kafka.server.config.ReplicationConfigs;
+import org.apache.kafka.server.config.ServerConfigs;
+import org.apache.kafka.server.config.ServerLogConfigs;
+
+import java.util.Set;
+
+public class DynamicThreadPool {
+    public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
+            ServerConfigs.NUM_IO_THREADS_CONFIG,

Review Comment:
   Thank you for your patience.
   I've fixed it.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org