You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/10/26 15:33:56 UTC

[GitHub] [kafka] jolshan commented on a change in pull request #9473: KAFKA-10545: Create topic IDs in ZooKeeper and Controller

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:
users@infra.apache.org