You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2021/05/13 23:07:56 UTC

[incubator-pinot] branch compare-state-ignore-cases created (now 4171d56)

This is an automated email from the ASF dual-hosted git repository.

jlli pushed a change to branch compare-state-ignore-cases
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 4171d56  Compare state of rate limiting with ignoring cases

This branch includes the following new commits:

     new 4171d56  Compare state of rate limiting with ignoring cases

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[incubator-pinot] 01/01: Compare state of rate limiting with ignoring cases

Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch compare-state-ignore-cases
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 4171d56a171f4a4f887e01afc59d550ad86858e7
Author: Jack Li(Analytics Engineering) <jl...@jlli-mn1.linkedin.biz>
AuthorDate: Thu May 13 16:07:24 2021 -0700

    Compare state of rate limiting with ignoring cases
---
 .../controller/api/resources/PinotBrokerRestletResource.java     | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotBrokerRestletResource.java b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotBrokerRestletResource.java
index 5395e9c..fe436b1 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotBrokerRestletResource.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotBrokerRestletResource.java
@@ -221,21 +221,22 @@ public class PinotBrokerRestletResource {
       throw new ControllerApplicationException(LOGGER,
           String.format("'%s' is not a valid broker instance name.", brokerInstanceName), Response.Status.BAD_REQUEST);
     }
-    validateQueryQuotaStateChange(state);
+    String stateInUpperCases = state.toUpperCase();
+    validateQueryQuotaStateChange(stateInUpperCases);
     List<String> liveInstances = _pinotHelixResourceManager.getOnlineInstanceList();
     if (!liveInstances.contains(brokerInstanceName)) {
       throw new ControllerApplicationException(LOGGER, String.format("Instance '%s' not found.", brokerInstanceName),
           Response.Status.NOT_FOUND);
     }
-    _pinotHelixResourceManager.toggleQueryQuotaStateForBroker(brokerInstanceName, state);
+    _pinotHelixResourceManager.toggleQueryQuotaStateForBroker(brokerInstanceName, stateInUpperCases);
     String msg =
-        String.format("Set query rate limiting to: %s for all tables in broker: %s", state, brokerInstanceName);
+        String.format("Set query rate limiting to: %s for all tables in broker: %s", stateInUpperCases, brokerInstanceName);
     LOGGER.info(msg);
     return new SuccessResponse(msg);
   }
 
   private void validateQueryQuotaStateChange(String state) {
-    if (!"ENABLE".equalsIgnoreCase(state) && !"DISABLE".equalsIgnoreCase(state)) {
+    if (!"ENABLE".equals(state) && !"DISABLE".equals(state)) {
       throw new ControllerApplicationException(LOGGER, "Invalid query quota state: " + state,
           Response.Status.BAD_REQUEST);
     }

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