jolshan commented on a change in pull request #9473:
URL: https://github.com/apache/kafka/pull/9473#discussion_r512054701



##########
File path: core/src/main/scala/kafka/controller/ControllerContext.scala
##########
@@ -126,6 +130,23 @@ class ControllerContext {
     replicaStates.clear()
   }
 
+  def addTopicId(topic: String, id: UUID): Unit = {
+    topicIds.get(topic).foreach { existingId =>
+      if (!existingId.equals(id))
+        throw new IllegalStateException("topic ID map already contained ID for 
topic "
+          + topic + " and new ID " + id + " did not match existing ID "
+          + existingId)
+    }
+    topicIds.put(topic, id)

Review comment:
       Yeah. That makes sense to me.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to