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



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/queryquota/HelixExternalViewBasedQueryQuotaManager.java
##########
@@ -352,13 +369,42 @@ public void processQueryQuotaChange(ExternalView 
currentBrokerResource) {
         numRebuilt++;
       }
     }
+    if (isQueryRateLimitDisabled()) {
+      LOGGER.info("Query rate limiting is currently disabled for this broker. 
So it won't take effect immediately.");
+    }
     _lastKnownBrokerResourceVersion.set(currentVersionNumber);
     long endTime = System.currentTimeMillis();
     LOGGER
         .info("Processed query quota change in {}ms, {} out of {} query quota 
configs rebuilt.", (endTime - startTime),
             numRebuilt, _rateLimiterMap.size());
   }
 
+  /**
+   * Process query quota state change when instance config gets changed
+   */
+  public void processQueryQuotaInstanceConfigChange() {

Review comment:
       suggest renaming these two methods as per new change in config names

##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotBrokerRestletResource.java
##########
@@ -129,6 +133,40 @@
     }
   }
 
+
+  @POST
+  @Path("/brokers/instances/{instanceName}/qps")
+  @Produces(MediaType.APPLICATION_JSON)
+  @Consumes(MediaType.TEXT_PLAIN)
+  @ApiOperation(value = "Enable/disable the query rate limiting for a broker 
instance", notes = "Enable/disable the query rate limiting for a broker 
instance")
+  @ApiResponses(value = {@ApiResponse(code = 200, message = "Success"), 
@ApiResponse(code = 400, message = "Bad Request"), @ApiResponse(code = 404, 
message = "Instance not found"), @ApiResponse(code = 500, message = "Internal 
error")})
+  public SuccessResponse toggleQueryRateLimiting(
+      @ApiParam(value = "Broker instance name", required = true, example = 
"Broker_my.broker.com_30000") @PathParam("instanceName") String 
brokerInstanceName,
+      @ApiParam(value = "ENABLE|DISABLE", allowableValues = "ENABLE, DISABLE", 
required = true)  @QueryParam("state") String state) {
+    if (brokerInstanceName == null || 
!brokerInstanceName.startsWith("Broker_")) {
+      LOGGER.info("{} isn't a valid broker instance name", brokerInstanceName);
+      throw new ControllerApplicationException(LOGGER,
+          String.format("'%s' is not a valid broker instance name.", 
brokerInstanceName), Response.Status.BAD_REQUEST);

Review comment:
       nit: Create an error string, and then use it in log as well as exeption.
   Same in other places as well, will not repeat.




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



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

Reply via email to