jackjlli commented on a change in pull request #5724:
URL: https://github.com/apache/incubator-pinot/pull/5724#discussion_r459094346
##########
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:
Removed the duplicate logging.
----------------------------------------------------------------
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]