jsancio commented on code in PR #15986: URL: https://github.com/apache/kafka/pull/15986#discussion_r1624737125
########## raft/src/main/java/org/apache/kafka/raft/QuorumConfig.java: ########## @@ -199,6 +206,34 @@ private static Map<Integer, InetSocketAddress> parseVoterConnections( return voterMap; } + public static InetSocketAddress parseBootstrapServer(String bootstrapServer) { + String host = Utils.getHost(bootstrapServer); + if (host == null) { + throw new ConfigException( + String.format( + "Failed to parse host name from {} for the configuration {}. Each " + + "entry should be in the form \"{host}:{port}\"", + bootstrapServer, + QUORUM_BOOTSTRAP_SERVERS_CONFIG + ) + ); + } + + Integer port = Utils.getPort(bootstrapServer); + if (port == null) { + throw new ConfigException( + String.format( + "Failed to parse host port from {} for the configuration {}. Each " + + "entry should be in the form \"{host}:{port}\"", + bootstrapServer, + QUORUM_BOOTSTRAP_SERVERS_CONFIG + ) + ); + } + + return InetSocketAddress.createUnresolved(host, port); Review Comment: I agree. I have been fixing any code that resolves host names outside of the `NetworkClient`. This PR should not be resolving host names outside of the `NetworkClient`. Let me know if you find a case that violates this. -- 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