This is an automated email from the ASF dual-hosted git repository.

frankvicky pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2329def2ff9 KAFKA-18068: Fix the typo 
`PARTITIONER_ADPATIVE_PARTITIONING_ENABLE` in ProducerConfig (#20317)
2329def2ff9 is described below

commit 2329def2ff9ca4f7b9426af159b6fa19a839dc4d
Author: Ming-Yen Chung <[email protected]>
AuthorDate: Thu Aug 7 17:28:17 2025 +0800

    KAFKA-18068: Fix the typo `PARTITIONER_ADPATIVE_PARTITIONING_ENABLE` in 
ProducerConfig (#20317)
    
    Fixes a typo in ProducerConfig:  Renames
    `PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG` →
    `PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG`
    
    The old key is retained for backward compatibility.
    
    See: [KIP-1175: Fix the typo `PARTITIONER_ADPATIVE_PARTITIONING_ENABLE`
    in ProducerConfig](https://cwiki.apache.org/confluence/x/KYogFQ)
    
    Reviewers: Yung <[email protected]>, TengYao Chi
    <[email protected]>, Ken Huang <[email protected]>, Nick Guo
    <[email protected]>, Ranuga Disansa <[email protected]>
---
 .../java/org/apache/kafka/clients/producer/KafkaProducer.java  |  2 +-
 .../java/org/apache/kafka/clients/producer/ProducerConfig.java | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
index c4ace64b0e5..48be57f262b 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
@@ -418,7 +418,7 @@ public class KafkaProducer<K, V> implements Producer<K, V> {
             this.transactionManager = configureTransactionState(config, 
logContext);
             // There is no need to do work required for adaptive partitioning, 
if we use a custom partitioner.
             boolean enableAdaptivePartitioning = partitionerPlugin.get() == 
null &&
-                
config.getBoolean(ProducerConfig.PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG);
+                
config.getBoolean(ProducerConfig.PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG);
             RecordAccumulator.PartitionerConfig partitionerConfig = new 
RecordAccumulator.PartitionerConfig(
                 enableAdaptivePartitioning,
                 
config.getLong(ProducerConfig.PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG)
diff --git 
a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
index e28b5d30812..ff7079bcdab 100644
--- 
a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
+++ 
b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
@@ -101,8 +101,10 @@ public class ProducerConfig extends AbstractConfig {
                                                  + "similar or lower producer 
latency despite the increased linger.";
 
     /** <code>partitioner.adaptive.partitioning.enable</code> */
-    public static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG 
= "partitioner.adaptive.partitioning.enable";
-    private static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_DOC =
+    public static final String PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG 
= "partitioner.adaptive.partitioning.enable";
+    @Deprecated
+    public static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG 
= PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG;
+    private static final String PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_DOC =
             "When set to 'true', the producer will try to adapt to broker 
performance and produce more messages to partitions hosted on faster brokers. "
             + "If 'false', the producer will try to distribute messages 
uniformly. Note: this setting has no effect if a custom partitioner is used.";
 
@@ -111,7 +113,7 @@ public class ProducerConfig extends AbstractConfig {
     private static final String PARTITIONER_AVAILABILITY_TIMEOUT_MS_DOC =
             "If a broker cannot process produce requests from a partition for 
<code>" + PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG + "</code> time, "
             + "the partitioner treats that partition as not available.  If the 
value is 0, this logic is disabled. "
-            + "Note: this setting has no effect if a custom partitioner is 
used or <code>" + PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG
+            + "Note: this setting has no effect if a custom partitioner is 
used or <code>" + PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG
             + "</code> is set to 'false'.";
 
     /** <code>partitioner.ignore.keys</code> */
@@ -392,7 +394,7 @@ public class ProducerConfig extends AbstractConfig {
                                 .define(COMPRESSION_LZ4_LEVEL_CONFIG, 
Type.INT, CompressionType.LZ4.defaultLevel(), 
CompressionType.LZ4.levelValidator(), Importance.MEDIUM, 
COMPRESSION_LZ4_LEVEL_DOC)
                                 .define(COMPRESSION_ZSTD_LEVEL_CONFIG, 
Type.INT, CompressionType.ZSTD.defaultLevel(), 
CompressionType.ZSTD.levelValidator(), Importance.MEDIUM, 
COMPRESSION_ZSTD_LEVEL_DOC)
                                 .define(BATCH_SIZE_CONFIG, Type.INT, 16384, 
atLeast(0), Importance.MEDIUM, BATCH_SIZE_DOC)
-                                
.define(PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG, Type.BOOLEAN, true, 
Importance.LOW, PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_DOC)
+                                
.define(PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG, Type.BOOLEAN, true, 
Importance.LOW, PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_DOC)
                                 
.define(PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG, Type.LONG, 0, atLeast(0), 
Importance.LOW, PARTITIONER_AVAILABILITY_TIMEOUT_MS_DOC)
                                 .define(PARTITIONER_IGNORE_KEYS_CONFIG, 
Type.BOOLEAN, false, Importance.MEDIUM, PARTITIONER_IGNORE_KEYS_DOC)
                                 .define(LINGER_MS_CONFIG, Type.LONG, 5, 
atLeast(0), Importance.MEDIUM, LINGER_MS_DOC)

Reply via email to