manoj-mathivanan opened a new pull request, #18391: URL: https://github.com/apache/kafka/pull/18391
JIRA: [KAFKA-17544](https://issues.apache.org/jira/browse/KAFKA-17544) When performing perf tests, we can specify a payload using the --payloadFile parameter. This file is utilized during the load/performance testing process. However, if the file is large, it may result in the following error: ``` Exception in thread "main" java.lang.NegativeArraySizeException: -1040351534 at java.base/java.lang.String.<init>(String.java:568) ``` This issue is highlighted in java [docs](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#readAllBytes-java.nio.file.Path-) as well. Moving the file loading logic to java.util.Scanner and using [useDelimiter](https://docs.oracle.com/javase/8/docs/api/java/util/Scanner.html#useDelimiter-java.lang.String-) method for splitting the strings. ### Committer Checklist (excluded from commit message) - [x] Verify design and implementation - [x] Verify test coverage and CI build status - [x] Verify documentation (including upgrade notes) -- 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]
