cmccabe commented on code in PR #12063: URL: https://github.com/apache/kafka/pull/12063#discussion_r852487013
########## core/src/main/scala/kafka/server/metadata/BrokerMetadataListener.scala: ########## @@ -248,6 +248,24 @@ class BrokerMetadataListener( } } + // This is used in tests to alter the publisher that is in use by the broker. + def alterPublisher(publisher: MetadataPublisher): CompletableFuture[Void] = { + val event = new AlterPublisherEvent(publisher) + eventQueue.append(event) + event.future + } + + class AlterPublisherEvent(publisher: MetadataPublisher) + extends EventQueue.FailureLoggingEvent(log) { + val future = new CompletableFuture[Void]() + + override def run(): Unit = { + _publisher = Some(publisher) + log.info(s"Set publisher to ${publisher}") Review Comment: This is only used in unit tests. I think it's good to have it in the log4j since earlier events may have been published differently by the earlier publisher. -- 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