Skip to content

Commit 2329def

Browse files
authored
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]>
1 parent 21db7e0 commit 2329def

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public KafkaProducer(Properties properties, Serializer<K> keySerializer, Seriali
418418
this.transactionManager = configureTransactionState(config, logContext);
419419
// There is no need to do work required for adaptive partitioning, if we use a custom partitioner.
420420
boolean enableAdaptivePartitioning = partitionerPlugin.get() == null &&
421-
config.getBoolean(ProducerConfig.PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG);
421+
config.getBoolean(ProducerConfig.PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG);
422422
RecordAccumulator.PartitionerConfig partitionerConfig = new RecordAccumulator.PartitionerConfig(
423423
enableAdaptivePartitioning,
424424
config.getLong(ProducerConfig.PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG)

clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ public class ProducerConfig extends AbstractConfig {
101101
+ "similar or lower producer latency despite the increased linger.";
102102

103103
/** <code>partitioner.adaptive.partitioning.enable</code> */
104-
public static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG = "partitioner.adaptive.partitioning.enable";
105-
private static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_DOC =
104+
public static final String PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG = "partitioner.adaptive.partitioning.enable";
105+
@Deprecated
106+
public static final String PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG = PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG;
107+
private static final String PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_DOC =
106108
"When set to 'true', the producer will try to adapt to broker performance and produce more messages to partitions hosted on faster brokers. "
107109
+ "If 'false', the producer will try to distribute messages uniformly. Note: this setting has no effect if a custom partitioner is used.";
108110

@@ -111,7 +113,7 @@ public class ProducerConfig extends AbstractConfig {
111113
private static final String PARTITIONER_AVAILABILITY_TIMEOUT_MS_DOC =
112114
"If a broker cannot process produce requests from a partition for <code>" + PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG + "</code> time, "
113115
+ "the partitioner treats that partition as not available. If the value is 0, this logic is disabled. "
114-
+ "Note: this setting has no effect if a custom partitioner is used or <code>" + PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG
116+
+ "Note: this setting has no effect if a custom partitioner is used or <code>" + PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG
115117
+ "</code> is set to 'false'.";
116118

117119
/** <code>partitioner.ignore.keys</code> */
@@ -392,7 +394,7 @@ public class ProducerConfig extends AbstractConfig {
392394
.define(COMPRESSION_LZ4_LEVEL_CONFIG, Type.INT, CompressionType.LZ4.defaultLevel(), CompressionType.LZ4.levelValidator(), Importance.MEDIUM, COMPRESSION_LZ4_LEVEL_DOC)
393395
.define(COMPRESSION_ZSTD_LEVEL_CONFIG, Type.INT, CompressionType.ZSTD.defaultLevel(), CompressionType.ZSTD.levelValidator(), Importance.MEDIUM, COMPRESSION_ZSTD_LEVEL_DOC)
394396
.define(BATCH_SIZE_CONFIG, Type.INT, 16384, atLeast(0), Importance.MEDIUM, BATCH_SIZE_DOC)
395-
.define(PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_CONFIG, Type.BOOLEAN, true, Importance.LOW, PARTITIONER_ADPATIVE_PARTITIONING_ENABLE_DOC)
397+
.define(PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_CONFIG, Type.BOOLEAN, true, Importance.LOW, PARTITIONER_ADAPTIVE_PARTITIONING_ENABLE_DOC)
396398
.define(PARTITIONER_AVAILABILITY_TIMEOUT_MS_CONFIG, Type.LONG, 0, atLeast(0), Importance.LOW, PARTITIONER_AVAILABILITY_TIMEOUT_MS_DOC)
397399
.define(PARTITIONER_IGNORE_KEYS_CONFIG, Type.BOOLEAN, false, Importance.MEDIUM, PARTITIONER_IGNORE_KEYS_DOC)
398400
.define(LINGER_MS_CONFIG, Type.LONG, 5, atLeast(0), Importance.MEDIUM, LINGER_MS_DOC)

0 commit comments

Comments
 (0)