satishd commented on code in PR #16087: URL: https://github.com/apache/kafka/pull/16087#discussion_r1635823261
########## core/src/main/java/kafka/log/remote/quota/RLMQuotaManager.java: ########## @@ -77,16 +78,17 @@ public void updateQuota(Quota newQuota) { } } - public boolean isQuotaExceeded() { + public QuotaCheckResult checkQuota() { Sensor sensorInstance = sensor(); try { sensorInstance.checkQuotas(); } catch (QuotaViolationException qve) { LOGGER.debug("Quota violated for sensor ({}), metric: ({}), metric-value: ({}), bound: ({})", sensorInstance.name(), qve.metric().metricName(), qve.value(), qve.bound()); - return true; + long throttleTimeMs = QuotaUtils.throttleTime(qve, time.milliseconds()); + return new QuotaCheckResult(true, throttleTimeMs); Review Comment: We can return long and remove returning a `QuotaCHeckResult` wrapper. This will avoid creating a wrapper instance and add the respective util check to determine the quota is exceeded if the value > 0. -- 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