mjsax commented on code in PR #20325: URL: https://github.com/apache/kafka/pull/20325#discussion_r2275149725
########## core/src/main/scala/kafka/server/AutoTopicCreationManager.scala: ########## @@ -112,6 +128,45 @@ class DefaultAutoTopicCreationManager( } } + override def getTopicCreationErrors( + topicNames: Set[String] + ): Map[String, String] = { + val currentTime = System.currentTimeMillis() + val errors = mutable.Map.empty[String, String] + val expiredKeys = mutable.Set.empty[String] + + // Check requested topics and collect expired keys + topicNames.foreach { topicName => + Option(topicCreationErrorCache.get(topicName)) match { + case Some(cachedError) if (currentTime - cachedError.timestamp) <= errorCacheTtlMs => + errors.put(topicName, cachedError.errorMessage) + case Some(_) => Review Comment: Oh I see -- `Some(cachedError) if` is one statement in Scala. Interesting. Thanks for clarifying. -- 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