OmniaGM commented on code in PR #14881:
URL: https://github.com/apache/kafka/pull/14881#discussion_r1415612624


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -2741,6 +2755,18 @@ class ReplicaManager(val config: KafkaConfig,
     }
   }
 
+  private def mayUpdateTopicAssignment(partition: Partition, 
partitionDirectoryId: Option[Uuid]) = {
+    if (partitionDirectoryId.isDefined) {
+      val topicPartitionActualDirectory = partition.log.flatMap(log => 
logManager.directoryId(log.dir.getParent))
+      if 
(!topicPartitionActualDirectory.exists(partitionDirectoryId.contains)) {
+        topicPartitionActualDirectory
+          .flatMap(uuid => partition.topicId.map(topicId =>
+            directoryEventHandler.handleAssignment(new 
common.TopicIdPartition(topicId, partition.partitionId), uuid)
+          ))

Review Comment:
   replaced it with for each, don't know why i jumped to map here 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to