cmccabe commented on code in PR #13116:
URL: https://github.com/apache/kafka/pull/13116#discussion_r1127197623


##########
metadata/src/main/java/org/apache/kafka/controller/ControllerRequestContext.java:
##########
@@ -42,19 +45,39 @@ public static OptionalLong requestTimeoutMsToDeadlineNs(
     private final OptionalLong deadlineNs;
     private final RequestHeaderData requestHeader;
 
+    private final Optional<Consumer<Double>> requestedPartitionCountRecorder;
+

Review Comment:
   Yes, this is messy. I have a lot of ideas for improving this, but most of 
them would require substantial refactoring.
   
   For now, let's just get rid of the obvious bad stuff.
   * Using a double for number of partitions is a bit silly
   * "Recorder" is also a bit of a misnomer -- we are doing more than recording 
the number of partitions.
   * The Optional isn't needed -- just pass a Consumer that does nothing if you 
don't want to do anything.
   
   So maybe change it to something like `Consumer<Integer> 
applyPartitionChangeQuota` ?



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