divijvaidya commented on code in PR #12685:
URL: https://github.com/apache/kafka/pull/12685#discussion_r1250943138


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/BuiltInPartitioner.java:
##########
@@ -321,13 +322,20 @@ public int partition() {
         }
     }
 
-    /*
+    /**
      * Default hashing function to choose a partition from the serialized key 
bytes
      */
     public static int partitionForKey(final byte[] serializedKey, final int 
numPartitions) {
         return Utils.toPositive(Utils.murmur2(serializedKey)) % numPartitions;
     }
 
+    /**
+     * Default hashing function to choose a partition from the serialized key 
bytes
+     */
+    public static int partitionForKey(final ByteBuffer serializedKey, final 
int numPartitions) {
+        return Utils.toPositive(Utils.murmur2(serializedKey)) % numPartitions;

Review Comment:
   Got it.



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