cmccabe commented on code in PR #15986: URL: https://github.com/apache/kafka/pull/15986#discussion_r1619518236
########## raft/src/main/java/org/apache/kafka/raft/RequestManager.java: ########## @@ -17,108 +17,296 @@ package org.apache.kafka.raft; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; -import java.util.List; +import java.util.Iterator; import java.util.Map; -import java.util.OptionalInt; +import java.util.Optional; import java.util.OptionalLong; import java.util.Random; -import java.util.Set; +import org.apache.kafka.common.Node; +/** + * The request manager keeps tracks of the connection with remote replicas. + * + * When sending a request update this type by calling {@code onRequestSent(Node, long, long)}. When + * the RPC returns a response, update this manager with {@code onResponseResult(Node, long, boolean, long)}. + * + * Connections start in the ready state ({@code isReady(Node, long)} returns true). + * + * When a request times out or completes successfully the collection will transition back to the + * ready state. + * + * When a request completes with an error it still transition to the backoff state until + * {@code retryBackoffMs}. + */ public class RequestManager { - private final Map<Integer, ConnectionState> connections = new HashMap<>(); - private final List<Integer> voters = new ArrayList<>(); + private final Map<String, ConnectionState> connections = new HashMap<>(); Review Comment: I don't understand why you are changing this to treat node ID as a string. An Int seems better. -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org