Skip to content

Commit 55020f9

Browse files
authored
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]>
1 parent 1e4b8a1 commit 55020f9

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedConfig.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public final class DistributedConfig extends WorkerConfig {
119119
*/
120120
public static final String WORKER_UNSYNC_BACKOFF_MS_CONFIG = "worker.unsync.backoff.ms";
121121
private static final String WORKER_UNSYNC_BACKOFF_MS_DOC = "When the worker is out of sync with other workers and " +
122-
" fails to catch up within worker.sync.timeout.ms, leave the Connect cluster for this long before rejoining.";
122+
" fails to catch up within the <code>worker.sync.timeout.ms</code>, leave the Connect cluster for this long before rejoining.";
123123
public static final int WORKER_UNSYNC_BACKOFF_MS_DEFAULT = 5 * 60 * 1000;
124124

125125
public static final String CONFIG_STORAGE_PREFIX = "config.storage.";
@@ -206,20 +206,20 @@ public final class DistributedConfig extends WorkerConfig {
206206
public static final Long INTER_WORKER_KEY_SIZE_DEFAULT = null;
207207

208208
public static final String INTER_WORKER_KEY_TTL_MS_CONFIG = "inter.worker.key.ttl.ms";
209-
public static final String INTER_WORKER_KEY_TTL_MS_MS_DOC = "The TTL of generated session keys used for "
209+
public static final String INTER_WORKER_KEY_TTL_MS_DOC = "The TTL of generated session keys used for "
210210
+ "internal request validation (in milliseconds)";
211-
public static final int INTER_WORKER_KEY_TTL_MS_MS_DEFAULT = Math.toIntExact(TimeUnit.HOURS.toMillis(1));
211+
public static final int INTER_WORKER_KEY_TTL_MS_DEFAULT = Math.toIntExact(TimeUnit.HOURS.toMillis(1));
212212

213213
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG = "inter.worker.signature.algorithm";
214214
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT = "HmacSHA256";
215-
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DOC = "The algorithm used to sign internal requests"
216-
+ "The algorithm '" + INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + "' will be used as a default on JVMs that support it; "
215+
public static final String INTER_WORKER_SIGNATURE_ALGORITHM_DOC = "The algorithm used to sign internal requests. "
216+
+ "The algorithm '" + INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT + "' will be used as a default on JVMs that support it; "
217217
+ "on other JVMs, no default is used and a value for this property must be manually specified in the worker config.";
218218

219219
public static final String INTER_WORKER_VERIFICATION_ALGORITHMS_CONFIG = "inter.worker.verification.algorithms";
220220
public static final List<String> INTER_WORKER_VERIFICATION_ALGORITHMS_DEFAULT = List.of(INTER_WORKER_SIGNATURE_ALGORITHM_DEFAULT);
221221
public static final String INTER_WORKER_VERIFICATION_ALGORITHMS_DOC = "A list of permitted algorithms for verifying internal requests, "
222-
+ "which must include the algorithm used for the " + INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + " property. "
222+
+ "which must include the algorithm used for the <code>" + INTER_WORKER_SIGNATURE_ALGORITHM_CONFIG + "</code> property. "
223223
+ "The algorithm(s) '" + INTER_WORKER_VERIFICATION_ALGORITHMS_DEFAULT + "' will be used as a default on JVMs that provide them; "
224224
+ "on other JVMs, no default is used and a value for this property must be manually specified in the worker config.";
225225
private final Crypto crypto;
@@ -490,10 +490,10 @@ private static ConfigDef config(Crypto crypto) {
490490
SCHEDULED_REBALANCE_MAX_DELAY_MS_DOC)
491491
.define(INTER_WORKER_KEY_TTL_MS_CONFIG,
492492
ConfigDef.Type.INT,
493-
INTER_WORKER_KEY_TTL_MS_MS_DEFAULT,
493+
INTER_WORKER_KEY_TTL_MS_DEFAULT,
494494
between(0, Integer.MAX_VALUE),
495495
ConfigDef.Importance.LOW,
496-
INTER_WORKER_KEY_TTL_MS_MS_DOC)
496+
INTER_WORKER_KEY_TTL_MS_DOC)
497497
.define(INTER_WORKER_KEY_GENERATION_ALGORITHM_CONFIG,
498498
ConfigDef.Type.STRING,
499499
defaultKeyGenerationAlgorithm(crypto),

connect/runtime/src/test/java/org/apache/kafka/connect/runtime/distributed/DistributedHerderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ public void testPatchConnectorConfig() throws Exception {
25632563

25642564
@Test
25652565
public void testKeyRotationWhenWorkerBecomesLeader() {
2566-
long rotationTtlDelay = DistributedConfig.INTER_WORKER_KEY_TTL_MS_MS_DEFAULT;
2566+
long rotationTtlDelay = DistributedConfig.INTER_WORKER_KEY_TTL_MS_DEFAULT;
25672567
when(member.memberId()).thenReturn("member");
25682568
when(member.currentProtocolVersion()).thenReturn(CONNECT_PROTOCOL_V2);
25692569

@@ -2616,7 +2616,7 @@ public void testKeyRotationWhenWorkerBecomesLeader() {
26162616

26172617
@Test
26182618
public void testKeyRotationDisabledWhenWorkerBecomesFollower() {
2619-
long rotationTtlDelay = DistributedConfig.INTER_WORKER_KEY_TTL_MS_MS_DEFAULT;
2619+
long rotationTtlDelay = DistributedConfig.INTER_WORKER_KEY_TTL_MS_DEFAULT;
26202620
when(member.memberId()).thenReturn("member");
26212621
when(member.currentProtocolVersion()).thenReturn(CONNECT_PROTOCOL_V2);
26222622

0 commit comments

Comments
 (0)