aloknnikhil commented on a change in pull request #9916:
URL: https://github.com/apache/kafka/pull/9916#discussion_r561375612



##########
File path: raft/src/test/java/org/apache/kafka/raft/RaftTestUtil.java
##########
@@ -16,36 +16,15 @@
  */
 package org.apache.kafka.raft;
 
-import org.apache.kafka.common.Node;
-
 import java.net.InetSocketAddress;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
 public class RaftTestUtil {
-    public static RaftConfig buildRaftConfig(
-            int requestTimeoutMs,
-            int retryBackoffMs,
-            int electionTimeoutMs,
-            int electionBackoffMs,
-            int fetchTimeoutMs,
-            int appendLingerMs,
-            List<Node> voterNodes
-    ) {
-        Map<Integer, InetSocketAddress> voterConnections = voterNodes.stream()
-            .collect(Collectors.toMap(Node::id, node -> new 
InetSocketAddress(node.host(), node.port())));
-        return new RaftConfig(voterConnections, requestTimeoutMs, 
retryBackoffMs, electionTimeoutMs, electionBackoffMs,
-            fetchTimeoutMs, appendLingerMs);
-    }
-
-    public static List<Node> voterNodesFromIds(Set<Integer> voterIds,
+    public static Map<Integer, InetSocketAddress> 
voterNodesFromIds(Set<Integer> voterIds,
                                                Function<Integer, 
InetSocketAddress> voterAddressGenerator) {
-        return voterIds.stream().map(voterId -> {
-            InetSocketAddress voterAddress = 
voterAddressGenerator.apply(voterId);
-            return new Node(voterId, voterAddress.getHostName(), 
voterAddress.getPort());
-        }).collect(Collectors.toList());
+        return voterIds.stream().collect(Collectors.toMap(id -> id, 
voterAddressGenerator));

Review comment:
       I'm up for removing any extra files when we don't need them. Aaaaaaand, 
it's gone.




----------------------------------------------------------------
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:
[email protected]


Reply via email to