cmccabe commented on a change in pull request #10949: URL: https://github.com/apache/kafka/pull/10949#discussion_r661871442
########## File path: metadata/src/main/java/org/apache/kafka/metadata/BrokerRegistration.java ########## @@ -18,20 +18,39 @@ package org.apache.kafka.metadata; import org.apache.kafka.common.Endpoint; +import org.apache.kafka.common.Node; import org.apache.kafka.common.Uuid; +import org.apache.kafka.common.metadata.RegisterBrokerRecord; +import org.apache.kafka.common.metadata.RegisterBrokerRecord.BrokerEndpoint; +import org.apache.kafka.common.metadata.RegisterBrokerRecord.BrokerFeature; +import org.apache.kafka.common.security.auth.SecurityProtocol; +import org.apache.kafka.server.common.ApiMessageAndVersion; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; +import static org.apache.kafka.common.metadata.MetadataRecordType.REGISTER_BROKER_RECORD; + + /** * An immutable class which represents broker registrations. */ public class BrokerRegistration { + private static Map<String, Endpoint> listenersToMap(Collection<Endpoint> listeners) { + Map<String, Endpoint> listenersMap = new HashMap<>(); + for (Endpoint endpoint : listeners) { + listenersMap.put(endpoint.listenerName().get(), endpoint); Review comment: Supposedly it's mandatory for brokers, but optional for clients (which really means they should have used a different type for the optional scenarios.) I will add a check to the constructor that all listeners have names. -- 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