From f0fae82ef69f8c5cc3f0cbd707e908e11df03b06 Mon Sep 17 00:00:00 2001 From: Ming-Yen Chung Date: Wed, 6 Aug 2025 23:52:48 +0800 Subject: [PATCH] Fix the typo `PARTITIONER_ADPATIVE_PARTITIONING_ENABLE` in ProducerConfig --- .../apache/kafka/clients/producer/KafkaProducer.java | 2 +- .../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 c4ace64b0e52b..48be57f262b77 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 KafkaProducer(Properties properties, Serializer keySerializer, Seriali 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 e28b5d30812ab..ff7079bcdab37 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."; /** partitioner.adaptive.partitioning.enable */ - 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 " + PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG + " 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 " + PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG + + "Note: this setting has no effect if a custom partitioner is used or " + PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG + " is set to 'false'."; /** partitioner.ignore.keys */ @@ -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)