frankvicky commented on code in PR #20567:
URL: https://github.com/apache/kafka/pull/20567#discussion_r2386513598
##########
server/src/main/java/org/apache/kafka/server/config/AbstractKafkaConfig.java:
##########
@@ -161,6 +169,76 @@ public static Map<String, String> getMap(String propName,
String propValue) {
}
}
+ public static List<Endpoint> listenerListToEndPoints(List<String>
listeners, Map<ListenerName, SecurityProtocol> securityProtocolMap) {
+ return listenerListToEndPoints(listeners, securityProtocolMap, true);
+ }
+
+ public static List<Endpoint> listenerListToEndPoints(List<String>
listeners, Map<ListenerName, SecurityProtocol> securityProtocolMap, boolean
requireDistinctPorts) {
+ List<Endpoint> endPoints;
+ try {
+ endPoints = SocketServerConfigs.listenerListToEndPoints(listeners,
securityProtocolMap);
+ } catch (Exception e) {
+ throw new IllegalArgumentException(String.format("Error creating
broker listeners from '%s': %s", listeners, e.getMessage()), e);
+ }
+ validate(endPoints, listeners, requireDistinctPorts);
+ return endPoints;
+ }
Review Comment:
Could we do the following?
```suggestion
public static List<Endpoint> listenerListToEndPoints(List<String>
listeners, Map<ListenerName, SecurityProtocol> securityProtocolMap, boolean
requireDistinctPorts) {
try {
List<Endpoint> endPoints =
SocketServerConfigs.listenerListToEndPoints(listeners, securityProtocolMap);
validate(endPoints, listeners, requireDistinctPorts);
return endPoints;
} catch (Exception e) {
throw new IllegalArgumentException(String.format("Error creating
broker listeners from '%s': %s", listeners, e.getMessage()), e);
}
}
```
##########
server/src/main/java/org/apache/kafka/server/config/AbstractKafkaConfig.java:
##########
@@ -52,6 +56,10 @@
* For more details check KAFKA-15853
*/
public abstract class AbstractKafkaConfig extends AbstractConfig {
+
+ private static final InetAddressValidator INET_ADDRESS_VALIDATOR =
InetAddressValidator.getInstance();
+
+
Review Comment:
Redundant empty line.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]