Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/main/scala/kafka/tools/TestRaftServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class TestRaftServer(
workloadGenerator = new RaftWorkloadGenerator(
raftManager,
time,
recordsPerSec = 20000,
recordSize = 256
recordsPerSec = throughput,
recordSize = recordSize
)

val requestHandler = new TestRaftRequestHandler(
Expand Down Expand Up @@ -428,7 +428,7 @@ object TestRaftServer extends Logging {
}

private class TestRaftServerOptions(args: Array[String]) extends CommandDefaultOptions(args) {
val configOpt: OptionSpec[String] = parser.accepts("config", "Required configured file")
val configOpt: OptionSpec[String] = parser.accepts("config", "REQUIRED: The configured file")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use CommandLineUtils.checkRequiredArgs to check the existence in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks.

Verification:

$ bin/test-kraft-server-start.sh
[2025-08-21 00:41:04,035] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Standalone raft server for performance testing
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version.                
$ bin/test-kraft-server-start.sh --config config/kraft.properties 
[2025-08-21 00:41:12,627] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Missing required argument "[replica-directory-id]"
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version.                
$ bin/test-kraft-server-start.sh --replica-directory-id b8tRS7h4TJ2Vt43Dp85v2A
[2025-08-21 00:41:22,486] INFO Registered `kafka:type=kafka.Log4jController` MBean (kafka.utils.Log4jControllerRegistration$)
Missing required argument "[config]"
Option                                  Description                           
------                                  -----------                           
--config <String: filename>             REQUIRED: The configured file         
--help                                  Print usage information.              
--record-size <Integer: size in bytes>  The size of each record (default: 256)
--replica-directory-id <String:         REQUIRED: The directory id of the     
  directory id>                           replica                             
--throughput <Integer: records/sec>     The number of records per second the  
                                          leader will write to the metadata   
                                          topic (default: 5000)               
--version                               Display Kafka version. 

.withRequiredArg
.describedAs("filename")
.ofType(classOf[String])
Expand All @@ -446,7 +446,7 @@ object TestRaftServer extends Logging {
.ofType(classOf[Int])
.defaultsTo(256)

val directoryId: OptionSpec[String] = parser.accepts("replica-directory-id", "The directory id of the replica")
val directoryId: OptionSpec[String] = parser.accepts("replica-directory-id", "REQUIRED: The directory id of the replica")
.withRequiredArg
.describedAs("directory id")
.ofType(classOf[String])
Expand Down