This is an automated email from the ASF dual-hosted git repository.
mimaison 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 55020f909d2 MINOR: Improve the documentation content for
DistributedConfig (#20576)
55020f909d2 is described below
commit 55020f909d2707fd2ff22e436a56daf094c6c9ed
Author: majialong <[email protected]>
AuthorDate: Wed Sep 24 20:56:13 2025 +0800
MINOR: Improve the documentation content for DistributedConfig (#20576)
1. Fix doc of `inter.worker.signature.algorithm` config in
`DistributedConfig`.
2. Improve the style of the `inter.worker.verification.algorithms` and
`worker.unsync.backoff.ms` config.
3. `INTER_WORKER_KEY_TTL_MS_MS_DOC` -> `INTER_WORKER_KEY_TTL_MS_DOC`.
Reviewers: Mickael Maison <[email protected]>
---
.../connect/runtime/distributed/DistributedConfig.java | 16 ++++++++--------
.../runtime/distributed/DistributedHerderTest.java | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedConfig.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedConfig.java
index 6b209da331a..ccf33926bf9 100644
---
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedConfig.java
+++
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedConfig.java
@@ -119,7 +119,7 @@ public final class DistributedConfig extends WorkerConfig {
*/
public static final String WORKER_UNSYNC_BACKOFF_MS_CONFIG =
"worker.unsync.backoff.ms";
private static final String WORKER_UNSYNC_BACKOFF_MS_DOC = "When the
worker is out of sync with other workers and " +
- " fails to catch up within worker.sync.timeout.ms, leave the
Connect cluster for this long before rejoining.";
+ " fails to catch up within the
<code>worker.sync.timeout.ms</code>, leave the Connect cluster for this long
before rejoining.";
public static final int WORKER_UNSYNC_BACKOFF_MS_DEFAULT = 5 * 60 * 1000;
public static final String CONFIG_STORAGE_PREFIX = "config.storage.";
@@ -206,20 +206,20 @@ public final class DistributedConfig extends WorkerConfig
{
public static final Long INTER_WORKER_KEY_SIZE_DEFAULT = null;
public static final String INTER_WORKER_KEY_TTL_MS_CONFIG =
"inter.worker.key.ttl.ms";
- public static final String INTER_WORKER_KEY_TTL_MS_MS_DOC = "The TTL of
generated session keys used for "
+ public static final String INTER_WORKER_KEY_TTL_MS_DOC = "The TTL of
generated session keys used for "
+ "internal request validation (in milliseconds)";
- public static final int INTER_WORKER_KEY_TTL_MS_MS_DEFAULT =
Math.toIntExact(TimeUnit.HOURS.toMillis(1));
+ public static final int INTER_WORKER_KEY_TTL_MS_DEFAULT =
Math.toIntExact(TimeUnit.HOURS.toMillis(1));
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG =
"inter.worker.signature.algorithm";
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT =
"HmacSHA256";
- public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DOC = "The
algorithm used to sign internal requests"
- + "The algorithm '" + INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + "'
will be used as a default on JVMs that support it; "
+ public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DOC = "The
algorithm used to sign internal requests. "
+ + "The algorithm '" + INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT +
"' will be used as a default on JVMs that support it; "
+ "on other JVMs, no default is used and a value for this property
must be manually specified in the worker config.";
public static final String INTER_WORKER_VERIFICATION_ALGORITHMS_CONFIG =
"inter.worker.verification.algorithms";
public static final List<String>
INTER_WORKER_VERIFICATION_ALGORITHMS_DEFAULT =
List.of(INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT);
public static final String INTER_WORKER_VERIFICATION_ALGORITHMS_DOC = "A
list of permitted algorithms for verifying internal requests, "
- + "which must include the algorithm used for the " +
INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + " property. "
+ + "which must include the algorithm used for the <code>" +
INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + "</code> property. "
+ "The algorithm(s) '" + INTER_WORKER_VERIFICATION_ALGORITHMS_DEFAULT
+ "' will be used as a default on JVMs that provide them; "
+ "on other JVMs, no default is used and a value for this property
must be manually specified in the worker config.";
private final Crypto crypto;
@@ -490,10 +490,10 @@ public final class DistributedConfig extends WorkerConfig
{
SCHEDULED_REBALANCE_MAX_DELAY_MS_DOC)
.define(INTER_WORKER_KEY_TTL_MS_CONFIG,
ConfigDef.Type.INT,
- INTER_WORKER_KEY_TTL_MS_MS_DEFAULT,
+ INTER_WORKER_KEY_TTL_MS_DEFAULT,
between(0, Integer.MAX_VALUE),
ConfigDef.Importance.LOW,
- INTER_WORKER_KEY_TTL_MS_MS_DOC)
+ INTER_WORKER_KEY_TTL_MS_DOC)
.define(INTER_WORKER_KEY_GENERATION_ALGORITHM_CONFIG,
ConfigDef.Type.STRING,
defaultKeyGenerationAlgorithm(crypto),
diff --git
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java
index fcee7cb4db4..820de522f12 100644
---
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java
+++
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java
@@ -2563,7 +2563,7 @@ public class DistributedHerderTest {
@Test
public void testKeyRotationWhenWorkerBecomesLeader() {
- long rotationTtlDelay =
DistributedConfig.INTER_WORKER_KEY_TTL_MS_MS_DEFAULT;
+ long rotationTtlDelay =
DistributedConfig.INTER_WORKER_KEY_TTL_MS_DEFAULT;
when(member.memberId()).thenReturn("member");
when(member.currentProtocolVersion()).thenReturn(CONNECT_PROTOCOL_V2);
@@ -2616,7 +2616,7 @@ public class DistributedHerderTest {
@Test
public void testKeyRotationDisabledWhenWorkerBecomesFollower() {
- long rotationTtlDelay =
DistributedConfig.INTER_WORKER_KEY_TTL_MS_MS_DEFAULT;
+ long rotationTtlDelay =
DistributedConfig.INTER_WORKER_KEY_TTL_MS_DEFAULT;
when(member.memberId()).thenReturn("member");
when(member.currentProtocolVersion()).thenReturn(CONNECT_PROTOCOL_V2);