ivanyu commented on code in PR #19850:
URL: https://github.com/apache/kafka/pull/19850#discussion_r3330071991


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -1220,14 +1230,22 @@ public static final class PartitionerConfig {
          * @param partitionAvailabilityTimeoutMs If a broker cannot process 
produce requests from a partition
          *        for the specified time, the partition is treated by the 
partitioner as not available.
          *        If the timeout is 0, this logic is disabled.
+         * @param rackAware Whether the built-in partitioner is configured to 
be rack-aware.
+         * @param rack The producer rack.
          */
-        public PartitionerConfig(boolean enableAdaptivePartitioning, long 
partitionAvailabilityTimeoutMs) {
+        public PartitionerConfig(boolean enableAdaptivePartitioning, long 
partitionAvailabilityTimeoutMs, boolean rackAware, String rack) {
             this.enableAdaptivePartitioning = enableAdaptivePartitioning;
             this.partitionAvailabilityTimeoutMs = 
partitionAvailabilityTimeoutMs;
+            this.rackAware = rackAware;
+            this.rack = rack;
+
+            if (rackAware && Utils.isBlank(rack)) {
+                throw new IllegalArgumentException("client.rack must be 
provided if partitioner.rack.aware is enabled");

Review Comment:
   @chia7712 done, please have a look: 
https://github.com/apache/kafka/pull/22433



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