noob-se7en commented on code in PR #16572:
URL: https://github.com/apache/pinot/pull/16572#discussion_r2287695155


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/ServerRateLimitConfigChangeListener.java:
##########
@@ -37,24 +37,35 @@ public ServerRateLimitConfigChangeListener(ServerMetrics 
serverMetrics) {
 
   @Override
   public void onChange(Set<String> changedConfigs, Map<String, String> 
clusterConfigs) {
-    if 
(!changedConfigs.contains(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT))
 {
-      LOGGER.info("ChangedConfigs: {} does not contain: {}. Skipping updates", 
changedConfigs,
-          CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT);
+    if 
(!changedConfigs.contains(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT)
+        && 
!changedConfigs.contains(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT_BYTES))
 {
+      LOGGER.info("ChangedConfigs: {} does not contain: {} or {}. Skipping 
updates", changedConfigs,
+          CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT,
+          
CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT_BYTES);
       return;
     }
-    // Init serverRateLimit as default rate limit in-case serverRateLimit 
config is deleted/removed from cluster
-    // configs.
-    double serverRateLimit = 
CommonConstants.Server.DEFAULT_SERVER_CONSUMPTION_RATE_LIMIT;
-    if 
(clusterConfigs.containsKey(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT))
 {
-      try {
-        serverRateLimit =
-            
Double.parseDouble(clusterConfigs.get(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT));
-      } catch (NumberFormatException e) {
-        LOGGER.error("Invalid rate limit config value: {}. Ignoring the config 
change",
-            
clusterConfigs.get(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT),
 e);
-        return;
-      }
+
+    String configKey;
+    RealtimeConsumptionRateManager.ThrottlingStrategy throttlingStrategy;
+
+    if 
(clusterConfigs.containsKey(CommonConstants.Server.CONFIG_OF_SERVER_CONSUMPTION_RATE_LIMIT_BYTES))
 {

Review Comment:
   Thank you. Have addressed this.



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

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to