You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ce...@apache.org on 2023/02/28 14:28:00 UTC

[kafka] branch trunk updated: MINOR: ExponentialBackoff Javadoc improvements (#13317)

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

cegerton 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 d143d349ec6 MINOR: ExponentialBackoff Javadoc improvements (#13317)
d143d349ec6 is described below

commit d143d349ec6b51e0d95bbc794a21f93091c876fe
Author: Yash Mayya <ya...@gmail.com>
AuthorDate: Tue Feb 28 19:57:37 2023 +0530

    MINOR: ExponentialBackoff Javadoc improvements (#13317)
    
    Reviewers: Chris Egerton <ch...@aiven.io>
---
 .../org/apache/kafka/common/utils/ExponentialBackoff.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/utils/ExponentialBackoff.java b/clients/src/main/java/org/apache/kafka/common/utils/ExponentialBackoff.java
index 7550184ba39..30a6bf8e7fe 100644
--- a/clients/src/main/java/org/apache/kafka/common/utils/ExponentialBackoff.java
+++ b/clients/src/main/java/org/apache/kafka/common/utils/ExponentialBackoff.java
@@ -20,12 +20,15 @@ package org.apache.kafka.common.utils;
 import java.util.concurrent.ThreadLocalRandom;
 
 /**
- * An utility class for keeping the parameters and providing the value of exponential
+ * A utility class for keeping the parameters and providing the value of exponential
  * retry backoff, exponential reconnect backoff, exponential timeout, etc.
+ * <p>
  * The formula is:
- * Backoff(attempts) = random(1 - jitter, 1 + jitter) * initialInterval * multiplier ^ attempts
- * If initialInterval is greater or equal than maxInterval, a constant backoff of will be provided
- * This class is thread-safe
+ * <pre>Backoff(attempts) = random(1 - jitter, 1 + jitter) * initialInterval * multiplier ^ attempts</pre>
+ * If {@code initialInterval} is greater than or equal to {@code maxInterval}, a constant backoff of
+ * {@code initialInterval} will be provided.
+ * <p>
+ * This class is thread-safe.
  */
 public class ExponentialBackoff {
     private final int multiplier;