m1a2st commented on code in PR #18592:
URL: https://github.com/apache/kafka/pull/18592#discussion_r1921073702


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -1080,11 +1079,7 @@ class LogManager(logDirs: Seq[File],
 
         log
       }
-      // When running a ZK controller, we may get a log that does not have a 
topic ID. Assign it here.
-      if (log.topicId.isEmpty) {
-        topicId.foreach(log.assignTopicId)
-      }
-
+      

Review Comment:
   Although this method doesn't utilize Optional's functionality internally, 
the calling method `Partition#createLogIfNotExists` uses Optional features, and 
Optional is still required when passing to the `UnifiedLog` constructor later. 
Therefore, I don't see a compelling reason to avoid using Optional at this 
point.
   
   
https://github.com/apache/kafka/blob/78e35457ee966695bd392aa4e4c16cbfe919ad4f/core/src/main/scala/kafka/cluster/Partition.scala#L463
   
https://github.com/apache/kafka/blob/78e35457ee966695bd392aa4e4c16cbfe919ad4f/core/src/main/scala/kafka/log/UnifiedLog.scala#L191



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

Reply via email to