gongxuanzhang commented on code in PR #16277:
URL: https://github.com/apache/kafka/pull/16277#discussion_r1634566222
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/BuiltInPartitioner.java:
##########
@@ -45,7 +45,7 @@ public class BuiltInPartitioner {
private final AtomicReference<StickyPartitionInfo> stickyPartitionInfo =
new AtomicReference<>();
// Visible and used for testing only.
- static volatile public Supplier<Integer> mockRandom = null;
+ protected static volatile Supplier<Integer> mockRandom = null;
Review Comment:
`mockRandom` is a static field, which means its behavior can be modified
anywhere in the test. There are many instances in the context, not just within
the test packages. Therefore, if we add a function and let the test module
extend this class, it will cause the already created objects to not work as
expected, requiring significant code changes.
--
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]