jsancio commented on a change in pull request #9050:
URL: https://github.com/apache/kafka/pull/9050#discussion_r462489390



##########
File path: core/src/main/scala/kafka/controller/KafkaController.scala
##########
@@ -2090,6 +2093,12 @@ case class ReplicaLeaderElection(
   callback: ElectLeadersCallback = _ => {}
 ) extends ControllerEvent {
   override def state: ControllerState = ControllerState.ManualLeaderBalance
+
+  override def preempt(): Unit = callback(
+    partitionsFromAdminClientOpt.fold(Map.empty[TopicPartition, 
Either[ApiError, Int]]) { partitions =>

Review comment:
       Yeah. The value returned by the `fold` is passed to `callback`. 
`foreach` would return `Unit`.

##########
File path: core/src/main/scala/kafka/controller/ControllerEventManager.scala
##########
@@ -140,6 +143,9 @@ class ControllerEventManager(controllerId: Int,
     }
   }
 
+  // for testing
+  private[controller] def setControllerEventThread(thread: 
ControllerEventThread): Unit = this.thread = thread

Review comment:
       We can remove this since we have `private[controller] var thread` with 
the same visibility.




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