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

[PR] MINOR: Refactor JmxTool and StreamsResetter to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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

   Refactor help and version handling in command-line tools by replacing duplicate code with `CommandLineUtils#maybePrintHelpOrVersion`.


-- 
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] MINOR: Refactor CLI tools to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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

   I ran the following command to verify, and the output is the same as before the change:
   
   ```
   # --- JmxTool ---
   echo "=== JmxTool --help ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.JmxTool --help |& head -n 3
   echo
   
   echo "=== JmxTool --version ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.JmxTool --version |& head -n 3
   echo
   
   echo "=== JmxTool (no args) ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.JmxTool |& head -n 3
   echo
   # -------------------------
   
   # --- StreamsResetter ---
   echo "=== StreamsResetter --help ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.StreamsResetter --help |& head -n 3
   echo
   
   echo "=== StreamsResetter --version ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.StreamsResetter --version |& head -n 3
   echo
   
   echo "=== StreamsResetter (no args) ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.StreamsResetter |& head -n 3
   echo
   # -------------------------
   
   # --- ReplicaVerificationTool ---
   echo "=== ReplicaVerificationTool --help ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.ReplicaVerificationTool --help |& head -n 3
   echo
   
   echo "=== ReplicaVerificationTool --version ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.ReplicaVerificationTool --version |& head -n 3
   echo
   
   echo "=== ReplicaVerificationTool (no args) ==="
   ./bin/kafka-run-class.sh org.apache.kafka.tools.ReplicaVerificationTool |& head -n 3
   echo
   # -------------------------
   
   ```
   
   ---
   
   Trunk output:
   ```
   === JmxTool --help ===
   Dump JMX values to standard output.
   Option                                   Description                           
   ------                                   -----------                           
   
   === JmxTool --version ===
   4.2.0-SNAPSHOT
   
   === JmxTool (no args) ===
   Dump JMX values to standard output.
   Option                                   Description                           
   ------                                   -----------                           
   
   === StreamsResetter --help ===
   This tool helps to quickly reset an application in order to reprocess its data from scratch.
   * This tool resets offsets of input topics to the earliest available offset (by default), or to a specific defined position* This tool deletes the internal topics that were created by Kafka Streams (topics starting with "<application.id>-").
   The tool finds these internal topics automatically. If the topics flagged automatically for deletion by the dry-run are unsuitable, you can specify a subset with the "--internal-topics" option.
   
   === StreamsResetter --version ===
   4.2.0-SNAPSHOT
   
   === StreamsResetter (no args) ===
   Missing required option(s) [application-id]
   Option (* = required)                  Description                            
   ---------------------                  -----------                            
   
   === ReplicaVerificationTool --help ===
   [2025-09-04 03:36:50,983] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   Validate that all replicas for a set of topics have the same data.
   Option                                 Description                        
   
   === ReplicaVerificationTool --version ===
   [2025-09-04 03:36:51,749] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   4.2.0-SNAPSHOT
   
   === ReplicaVerificationTool (no args) ===
   [2025-09-04 03:36:52,509] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   Validate that all replicas for a set of topics have the same data.
   Option                                 Description                        
   
   ```
   
   
   Branch output:
   ```
   === JmxTool --help ===
   Dump JMX values to standard output.
   Option                                   Description                           
   ------                                   -----------                           
   
   === JmxTool --version ===
   4.2.0-SNAPSHOT
   
   === JmxTool (no args) ===
   Dump JMX values to standard output.
   Option                                   Description                           
   ------                                   -----------                           
   
   === StreamsResetter --help ===
   This tool helps to quickly reset an application in order to reprocess its data from scratch.
   * This tool resets offsets of input topics to the earliest available offset (by default), or to a specific defined position* This tool deletes the internal topics that were created by Kafka Streams (topics starting with "<application.id>-").
   The tool finds these internal topics automatically. If the topics flagged automatically for deletion by the dry-run are unsuitable, you can specify a subset with the "--internal-topics" option.
   
   === StreamsResetter --version ===
   4.2.0-SNAPSHOT
   
   === StreamsResetter (no args) ===
   Missing required option(s) [application-id]
   Option (* = required)                  Description                            
   ---------------------                  -----------                            
   
   === ReplicaVerificationTool --help ===
   [2025-09-04 03:37:36,945] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   Validate that all replicas for a set of topics have the same data.
   Option                                 Description                        
   
   === ReplicaVerificationTool --version ===
   [2025-09-04 03:37:37,717] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   4.2.0-SNAPSHOT
   
   === ReplicaVerificationTool (no args) ===
   [2025-09-04 03:37:38,472] WARN This tool is deprecated and may be removed in a future major release. (org.apache.kafka.tools.ReplicaVerificationTool)
   Validate that all replicas for a set of topics have the same data.
   Option                                 Description                        
   
   ```
   
   


-- 
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] MINOR: Refactor JmxTool and StreamsResetter to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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

   Thanks for the PR. I see the same pattern in ReplicaVerificationTool.java; could you update it as well?
   Also, it would be great if you could provide the before and after output results for verification.


-- 
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] MINOR: Refactor CLI tools to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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

   Great. LGTM, thanks.


-- 
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] MINOR: Refactor CLI tools to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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

   @frankvicky 
   CI rerun passed, thanks for the reminder.


-- 
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] MINOR: Refactor CLI tools to use CommandLineUtils#maybePrintHelpOrVersion [kafka]

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


-- 
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