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


##########
docs/upgrade.html:
##########
@@ -44,6 +44,8 @@ <h5><a id="upgrade_400_notable" 
href="#upgrade_400_notable">Notable changes in 4
                         <li>The 
<code>kafka.common.requests.DescribeLogDirsResponse.ReplicaInfo</code> class 
was removed. Please use the 
<code>kafka.clients.admin.DescribeLogDirsResult.descriptions()</code> class
                             and 
<code>kafka.clients.admin.DescribeLogDirsResult.allDescriptions()</code>instead.
                         </li>
+                        <li>The 
<code>org.apache.kafka.clients.producer.UniformStickyPartitioner</code> class 
was removed.

Review Comment:
   Please add `DefaultPartitioner` as well



##########
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java:
##########
@@ -119,31 +119,6 @@ public MockProducer(final Cluster cluster,
         this.mockMetrics = new HashMap<>();
     }
 
-    /**
-     * Create a new mock producer with invented metadata the given 
autoComplete setting and key\value serializers.
-     *
-     * Equivalent to {@link #MockProducer(Cluster, boolean, Partitioner, 
Serializer, Serializer) new MockProducer(Cluster.empty(), autoComplete, new 
DefaultPartitioner(), keySerializer, valueSerializer)}
-     */
-    @SuppressWarnings("deprecation")
-    public MockProducer(final boolean autoComplete,
-                        final Serializer<K> keySerializer,
-                        final Serializer<V> valueSerializer) {
-        this(Cluster.empty(), autoComplete, new 
org.apache.kafka.clients.producer.internals.DefaultPartitioner(), 
keySerializer, valueSerializer);
-    }
-
-    /**
-     * Create a new mock producer with invented metadata the given 
autoComplete setting and key\value serializers.
-     *
-     * Equivalent to {@link #MockProducer(Cluster, boolean, Partitioner, 
Serializer, Serializer) new MockProducer(cluster, autoComplete, new 
DefaultPartitioner(), keySerializer, valueSerializer)}
-     */
-    @SuppressWarnings("deprecation")
-    public MockProducer(final Cluster cluster,
-                        final boolean autoComplete,
-                        final Serializer<K> keySerializer,
-                        final Serializer<V> valueSerializer) {
-        this(cluster, autoComplete, new 
org.apache.kafka.clients.producer.internals.DefaultPartitioner(), 
keySerializer, valueSerializer);

Review Comment:
   `MockProducer` has a null partitioner and it may cause NPE. Could you please 
fix that too? We can pick up a partition based on 
`cluster.partitionsForTopic(topic);`  if the partitioner is null



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