d8tltanc commented on a change in pull request #8683:
URL: https://github.com/apache/kafka/pull/8683#discussion_r439611544



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java
##########
@@ -34,19 +36,22 @@
  *
  */
 final class ClusterConnectionStates {
-    private final long reconnectBackoffInitMs;
-    private final long reconnectBackoffMaxMs;
-    private final static int RECONNECT_BACKOFF_EXP_BASE = 2;
-    private final double reconnectBackoffMaxExp;
     private final Map<String, NodeConnectionState> nodeState;
     private final Logger log;
+    private Set<String> connectingNodes;
+    private GeometricProgression reconnectBackoff;
+    private GeometricProgression connectionSetupTimeout;
 
-    public ClusterConnectionStates(long reconnectBackoffMs, long 
reconnectBackoffMaxMs, LogContext logContext) {
+    public ClusterConnectionStates(long reconnectBackoffMs, long 
reconnectBackoffMaxMs,
+                                   long connectionSetupTimeoutMs, long 
connectionSetupTimeoutMaxMs,
+                                   LogContext logContext) {
         this.log = logContext.logger(ClusterConnectionStates.class);
-        this.reconnectBackoffInitMs = reconnectBackoffMs;
-        this.reconnectBackoffMaxMs = reconnectBackoffMaxMs;
-        this.reconnectBackoffMaxExp = Math.log(this.reconnectBackoffMaxMs / 
(double) Math.max(reconnectBackoffMs, 1)) / 
Math.log(RECONNECT_BACKOFF_EXP_BASE);
+        this.reconnectBackoff = new GeometricProgression(
+                reconnectBackoffMs, 2, reconnectBackoffMaxMs, 0.2);

Review comment:
       Yes, we are reusing the code.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to