chia7712 commented on a change in pull request #9663:
URL: https://github.com/apache/kafka/pull/9663#discussion_r533126745



##########
File path: core/src/main/scala/kafka/cluster/Partition.scala
##########
@@ -1372,23 +1390,27 @@ class Partition(val topicPartition: TopicPartition,
    * Since our error was non-retryable we are okay staying in this state until 
we see new metadata from UpdateMetadata
    * or LeaderAndIsr
    */
-  private def handleAlterIsrResponse(proposedIsr: Set[Int], result: 
Either[Errors, LeaderAndIsr]): Unit = {
+  private def handleAlterIsrResponse(proposedIsrState: IsrState, result: 
Either[Errors, LeaderAndIsr]): Unit = {

Review comment:
       Could we rewrite it by currying?
   
   *Before*
   ```scala
       val callbackPartial = handleAlterIsrResponse(proposedIsrState, _ : 
Either[Errors, LeaderAndIsr])
   
       if (!alterIsrManager.enqueue(AlterIsrItem(topicPartition, 
newLeaderAndIsr, callbackPartial))) {
         throw new IllegalStateException(s"Failed to enqueue `AlterIsr` request 
with state " +
           s"$newLeaderAndIsr for partition $topicPartition")
       }
   ```
   
   *After*
   ```scala
   
       if (!alterIsrManager.enqueue(AlterIsrItem(topicPartition, 
newLeaderAndIsr, handleAlterIsrResponse(proposedIsrState)))) {
         throw new IllegalStateException(s"Failed to enqueue `AlterIsr` request 
with state " +
           s"$newLeaderAndIsr for partition $topicPartition")
       }
   ```




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