mcvsubbu commented on a change in pull request #7236:
URL: https://github.com/apache/pinot/pull/7236#discussion_r685618884



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java
##########
@@ -165,11 +157,13 @@ private void createOrUpdateRateLimiter(String 
tableNameWithType, ExternalView br
       QuotaConfig quotaConfig) {
     if (quotaConfig == null || quotaConfig.getMaxQueriesPerSecond() == null) {
       LOGGER.info("No qps config specified for table: {}", tableNameWithType);
+      buildEmptyOrResetRateLimiterInQueryQuotaEntity(tableNameWithType);
       return;
     }
 
     if (brokerResource == null) {
       LOGGER.warn("Failed to init qps quota for table {}. No broker resource 
connected!", tableNameWithType);
+      buildEmptyOrResetRateLimiterInQueryQuotaEntity(tableNameWithType);

Review comment:
       Do we still want to update it if EV is null (btw, can you change the var 
name to be `brokerResourceEV` ?)
   

##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java
##########
@@ -207,21 +201,50 @@ private void createOrUpdateRateLimiter(String 
tableNameWithType, ExternalView br
           "Rate limiter for table: {} has been initialized. Overall rate: {}. 
Per-broker rate: {}. Number of online broker instances: {}. Table config stat 
version: {}",
           tableNameWithType, overallRate, perBrokerRate, onlineCount, 
stat.getVersion());
     } else {
-      queryQuotaEntity.getRateLimiter().setRate(perBrokerRate);
+      RateLimiter rateLimiter = queryQuotaEntity.getRateLimiter();

Review comment:
       Am I understanding right, that this is the case when QPS quota gets 
added to a table (i.e. queroQuotaEntity already exists but rate limiter does 
not). If so, adding a comment here will be nice.




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

Reply via email to