chia7712 commented on code in PR #16277:
URL: https://github.com/apache/kafka/pull/16277#discussion_r1634421267


##########
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:
   Maybe a better way is to add a package-private method `random()`, and then 
in the `BuiltInPartitionerTest`  we create a `BuiltInPartitioner` with override 
`random()`. With that change we can remove "mock" from `BuiltInPartitioner`.



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

Reply via email to