You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/07/21 23:12:56 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #5724: Enable/disable query quotas per broker

jackjlli commented on a change in pull request #5724:
URL: https://github.com/apache/incubator-pinot/pull/5724#discussion_r458441365



##########
File path: pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java
##########
@@ -359,6 +372,27 @@ public void processQueryQuotaChange(ExternalView currentBrokerResource) {
             numRebuilt, _rateLimiterMap.size());
   }
 
+  /**
+   * Process query quota state change when instance config gets changed
+   */
+  public void processQueryQuotaInstanceConfigChange() {
+    getQueryQuotaEnabledFlagFromInstanceConfig();
+  }
+
+  private void getQueryQuotaEnabledFlagFromInstanceConfig() {
+    Map<String, String> instanceConfigsMap =
+        HelixHelper.getInstanceConfigsMapFor(_instanceId, _helixManager.getClusterName(),
+            _helixManager.getClusterManagmentTool());
+    String queryQuotaEnabled = instanceConfigsMap.getOrDefault(CommonConstants.Helix.QUERY_QUOTA_STATE_ENABLED, "true");
+    _enabled = Boolean.parseBoolean(queryQuotaEnabled);
+    LOGGER.info("Set query quota state to: {} for {} tables in the current broker.", _enabled ? "ENABLE" : "DISABLE",
+        _rateLimiterMap.size());

Review comment:
       I'd insist keeping the size of the map. That'll give us a good insight on how many tables are affected by this state change.
   And sure, I can add the state message in the message.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org