m1a2st commented on code in PR #20385:
URL: https://github.com/apache/kafka/pull/20385#discussion_r2298240936


##########
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java:
##########
@@ -292,13 +298,18 @@ public ConsumerPerfOptions(String[] args) {
                 .ofType(Integer.class)
                 .defaultsTo(1024 * 1024);
             resetBeginningOffsetOpt = parser.accepts("from-latest", "If the 
consumer does not already have an established " +
-                "offset to consume from, start with the latest message present 
in the log rather than the earliest message.");
+                "offset to consume from, start with the latest record present 
in the log rather than the earliest record.");
             socketBufferSizeOpt = parser.accepts("socket-buffer-size", "The 
size of the tcp RECV size.")
                 .withRequiredArg()
                 .describedAs("size")
                 .ofType(Integer.class)
                 .defaultsTo(2 * 1024 * 1024);
-            consumerConfigOpt = parser.accepts("consumer.config", "Consumer 
config properties file.")
+            consumerConfigOpt = parser.accepts("consumer.config", 
"(DEPRECATED) Consumer config properties file. " +
+                            "This option will be removed in a future version. 
Use --command-config instead")
+                .withRequiredArg()
+                .describedAs("config file")
+                .ofType(String.class);
+            commandConfigOpt = parser.accepts("command-config", "Consumer 
config properties file")

Review Comment:
   It seems that in the old version, `consumer.config` was not a required 
option. However, in the current version, users must provide either 
`consumer.config` or `command-config`. I think this is incorrect.
   > Exactly one of the following arguments is required: [consumer.config], 
[command-config]
   > Option                                   Description                       
    
   > ------                                   -----------                       
    
   > --bootstrap-server <String: server to    REQUIRED: The server(s) to 
connect to.



##########
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java:
##########
@@ -378,8 +402,10 @@ public Optional<Pattern> include() {
                     : Optional.empty();
         }
 
-        public long numMessages() {
-            return options.valueOf(numMessagesOpt);
+        public long numRecords() {
+            return options.has(numMessagesOpt)
+                    ? options.valueOf(numMessagesOpt)
+                    : options.valueOf(numRecordsOpt);

Review Comment:
   I think we should also add a warning message to notify users when they use 
the deprecated `messages` option.



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to