Jackie-Jiang commented on code in PR #15914: URL: https://github.com/apache/pinot/pull/15914#discussion_r2122225456
########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java: ########## @@ -87,15 +87,25 @@ public ConsumptionRateLimiter createServerRateLimiter(PinotConfiguration serverC double serverRateLimit = serverConfig.getProperty(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT, CommonConstants.Server.DEFAULT_SERVER_CONSUMPTION_RATE_LIMIT); + _serverRateLimiter = createServerRateLimiter(serverRateLimit, serverMetrics); + return _serverRateLimiter; + } + + private ConsumptionRateLimiter createServerRateLimiter(double serverRateLimit, ServerMetrics serverMetrics) { if (serverRateLimit > 0) { - LOGGER.info("Set up ConsumptionRateLimiter with rate limit: {}", serverRateLimit); + LOGGER.info("Set up ConsumptionRateLimiter with rate limit: {}.", serverRateLimit); Review Comment: (minor) We don't usually put `.` at the end of log. People might mix it with decimal point. Same for other places ########## pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java: ########## @@ -87,15 +87,25 @@ public ConsumptionRateLimiter createServerRateLimiter(PinotConfiguration serverC double serverRateLimit = serverConfig.getProperty(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT, CommonConstants.Server.DEFAULT_SERVER_CONSUMPTION_RATE_LIMIT); + _serverRateLimiter = createServerRateLimiter(serverRateLimit, serverMetrics); + return _serverRateLimiter; + } + + private ConsumptionRateLimiter createServerRateLimiter(double serverRateLimit, ServerMetrics serverMetrics) { if (serverRateLimit > 0) { - LOGGER.info("Set up ConsumptionRateLimiter with rate limit: {}", serverRateLimit); + LOGGER.info("Set up ConsumptionRateLimiter with rate limit: {}.", serverRateLimit); MetricEmitter metricEmitter = new MetricEmitter(serverMetrics, SERVER_CONSUMPTION_RATE_METRIC_KEY_NAME); - _serverRateLimiter = new RateLimiterImpl(serverRateLimit, metricEmitter); + return new RateLimiterImpl(serverRateLimit, metricEmitter); } else { - LOGGER.info("ConsumptionRateLimiter is disabled"); - _serverRateLimiter = NOOP_RATE_LIMITER; + LOGGER.info("ConsumptionRateLimiter is disabled."); + return NOOP_RATE_LIMITER; } - return _serverRateLimiter; + } + + public void updateServerRateLimiter(double serverRateLimit, ServerMetrics serverMetrics) { + LOGGER.info("Updating serverRateLimiter to new rate limit: {}, Prev serverRateLimiter: {}.", serverRateLimit, + _serverRateLimiter); Review Comment: (minor) ```suggestion LOGGER.info("Updating serverRateLimiter from: {} to: {}", serverRateLimit, _serverRateLimiter); ``` -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org