dajac commented on a change in pull request #8609:
URL: https://github.com/apache/kafka/pull/8609#discussion_r419946491



##########
File path: core/src/main/scala/kafka/controller/ControllerChannelManager.scala
##########
@@ -590,7 +569,26 @@ abstract class 
AbstractControllerBrokerRequestBatch(config: KafkaConfig,
 
           stateChangeLog.info(s"Sending StopReplica request for 
${partitionStates.size} " +
             s"replicas to broker $brokerId")
-          sendStopReplicaRequest(brokerId, brokerEpoch, false, 
stopReplicaTopicState)
+          val stopReplicaRequestBuilder = new StopReplicaRequest.Builder(
+            stopReplicaRequestVersion, controllerId, controllerEpoch, 
brokerEpoch,
+            false, stopReplicaTopicState.values.toBuffer.asJava)
+
+          sendRequest(brokerId, stopReplicaRequestBuilder, (r: 
AbstractResponse) => {
+            val stopReplicaResponse = r.asInstanceOf[StopReplicaResponse]

Review comment:
       I agree as well. Passing a function is a really good idea. I should have 
thought about it.




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


Reply via email to