This is an automated email from the ASF dual-hosted git repository.
rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new aff30d6380 Reverts interface refactor on
PinotBrokerRestletResource.java
aff30d6380 is described below
commit aff30d63806657544d3aa6d580a679d415231ee9
Author: soumitra-st <[email protected]>
AuthorDate: Fri Oct 13 10:41:19 2023 -0700
Reverts interface refactor on PinotBrokerRestletResource.java
reverting #8852. (#11797)
The annotations defined on the interface methods are not accessible using
https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html#getAnnotation-java.lang.Class-
API. The annotations are used to enforce authentication and authorization in
the request filter.
---
.../api/resources/PinotBrokerRestletResource.java | 150 ++++++++++---
.../api/services/PinotBrokerService.java | 231 ---------------------
2 files changed, 126 insertions(+), 255 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 347b850ecd..d58473af1c 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
@@ -19,6 +19,15 @@
package org.apache.pinot.controller.api.resources;
import com.google.common.collect.ImmutableList;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiKeyAuthDefinition;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.Authorization;
+import io.swagger.annotations.SecurityDefinition;
+import io.swagger.annotations.SwaggerDefinition;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -26,81 +35,145 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.helix.model.InstanceConfig;
import org.apache.pinot.common.exception.TableNotFoundException;
+import org.apache.pinot.controller.api.access.AccessType;
+import org.apache.pinot.controller.api.access.Authenticate;
import
org.apache.pinot.controller.api.exception.ControllerApplicationException;
-import org.apache.pinot.controller.api.services.PinotBrokerService;
import org.apache.pinot.controller.helix.core.PinotHelixResourceManager;
+import org.apache.pinot.core.auth.Actions;
+import org.apache.pinot.core.auth.Authorize;
+import org.apache.pinot.core.auth.TargetType;
import org.apache.pinot.spi.utils.CommonConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Api(tags = Constants.BROKER_TAG, authorizations = {@Authorization(value =
CommonConstants.SWAGGER_AUTHORIZATION_KEY)})
+@SwaggerDefinition(securityDefinition = @SecurityDefinition(
+ apiKeyAuthDefinitions = @ApiKeyAuthDefinition(
+ name = HttpHeaders.AUTHORIZATION,
+ in = ApiKeyAuthDefinition.ApiKeyLocation.HEADER,
+ key = CommonConstants.SWAGGER_AUTHORIZATION_KEY)))
@Path("/")
-public class PinotBrokerRestletResource implements PinotBrokerService {
+public class PinotBrokerRestletResource {
public static final Logger LOGGER =
LoggerFactory.getLogger(PinotBrokerRestletResource.class);
@Inject
PinotHelixResourceManager _pinotHelixResourceManager;
- @Override
- public Map<String, Map<String, List<String>>> listBrokersMapping(String
state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/brokers")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tenants and tables to brokers mappings",
+ notes = "List tenants and tables to brokers mappings")
+ public Map<String, Map<String, List<String>>> listBrokersMapping(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, Map<String, List<String>>> resultMap = new HashMap<>();
resultMap.put("tenants", getTenantsToBrokersMapping(state));
resultMap.put("tables", getTablesToBrokersMapping(state));
return resultMap;
}
- @Override
- public Map<String, List<String>> getTenantsToBrokersMapping(String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/brokers/tenants")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tenants to brokers mappings", notes = "List
tenants to brokers mappings")
+ public Map<String, List<String>> getTenantsToBrokersMapping(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, List<String>> resultMap = new HashMap<>();
_pinotHelixResourceManager.getAllBrokerTenantNames().stream()
.forEach(tenant -> resultMap.put(tenant, getBrokersForTenant(tenant,
state)));
return resultMap;
}
- @Override
- public List<String> getBrokersForTenant(String tenantName, String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/brokers/tenants/{tenantName}")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List brokers for a given tenant", notes = "List
brokers for a given tenant")
+ public List<String> getBrokersForTenant(
+ @ApiParam(value = "Name of the tenant", required = true)
@PathParam("tenantName") String tenantName,
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
List<InstanceInfo> instanceInfoList = getBrokersForTenantV2(tenantName,
state);
List<String> tenantBrokers =
instanceInfoList.stream().map(InstanceInfo::getInstanceName).collect(Collectors.toList());
return tenantBrokers;
}
- @Override
- public Map<String, List<String>> getTablesToBrokersMapping(String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/brokers/tables")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tables to brokers mappings", notes = "List
tables to brokers mappings")
+ public Map<String, List<String>> getTablesToBrokersMapping(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, List<String>> resultMap = new HashMap<>();
_pinotHelixResourceManager.getAllRawTables().stream()
.forEach(table -> resultMap.put(table, getBrokersForTable(table, null,
state)));
return resultMap;
}
- @Override
- public List<String> getBrokersForTable(String tableName, String
tableTypeStr, String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/brokers/tables/{tableName}")
+ @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action =
Actions.Table.GET_BROKER)
+ @ApiOperation(value = "List brokers for a given table", notes = "List
brokers for a given table")
+ public List<String> getBrokersForTable(
+ @ApiParam(value = "Name of the table", required = true)
@PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String
tableTypeStr,
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
List<InstanceInfo> instanceInfoList = getBrokersForTableV2(tableName,
tableTypeStr, state);
return
instanceInfoList.stream().map(InstanceInfo::getInstanceName).collect(Collectors.toList());
}
- @Override
- public Map<String, Map<String, List<InstanceInfo>>>
listBrokersMappingV2(String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/v2/brokers")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tenants and tables to brokers mappings",
+ notes = "List tenants and tables to brokers mappings")
+ public Map<String, Map<String, List<InstanceInfo>>> listBrokersMappingV2(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, Map<String, List<InstanceInfo>>> resultMap = new HashMap<>();
resultMap.put("tenants", getTenantsToBrokersMappingV2(state));
resultMap.put("tables", getTablesToBrokersMappingV2(state));
return resultMap;
}
- @Override
- public Map<String, List<InstanceInfo>> getTenantsToBrokersMappingV2(String
state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/v2/brokers/tenants")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tenants to brokers mappings", notes = "List
tenants to brokers mappings")
+ public Map<String, List<InstanceInfo>> getTenantsToBrokersMappingV2(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, List<InstanceInfo>> resultMap = new HashMap<>();
_pinotHelixResourceManager.getAllBrokerTenantNames().stream()
.forEach(tenant -> resultMap.put(tenant, getBrokersForTenantV2(tenant,
state)));
return resultMap;
}
- @Override
- public List<InstanceInfo> getBrokersForTenantV2(String tenantName, String
state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/v2/brokers/tenants/{tenantName}")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List brokers for a given tenant", notes = "List
brokers for a given tenant")
+ public List<InstanceInfo> getBrokersForTenantV2(
+ @ApiParam(value = "Name of the tenant", required = true)
@PathParam("tenantName") String tenantName,
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
if
(!_pinotHelixResourceManager.getAllBrokerTenantNames().contains(tenantName)) {
throw new ControllerApplicationException(LOGGER, String.format("Tenant
'%s' not found.", tenantName),
Response.Status.NOT_FOUND);
@@ -114,16 +187,28 @@ public class PinotBrokerRestletResource implements
PinotBrokerService {
return ImmutableList.copyOf(instanceInfoSet);
}
- @Override
- public Map<String, List<InstanceInfo>> getTablesToBrokersMappingV2(String
state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/v2/brokers/tables")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
+ @ApiOperation(value = "List tables to brokers mappings", notes = "List
tables to brokers mappings")
+ public Map<String, List<InstanceInfo>> getTablesToBrokersMappingV2(
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
Map<String, List<InstanceInfo>> resultMap = new HashMap<>();
_pinotHelixResourceManager.getAllRawTables().stream()
.forEach(table -> resultMap.put(table, getBrokersForTableV2(table,
null, state)));
return resultMap;
}
- @Override
- public List<InstanceInfo> getBrokersForTableV2(String tableName, String
tableTypeStr, String state) {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/v2/brokers/tables/{tableName}")
+ @Authorize(targetType = TargetType.CLUSTER, paramName = "tableName", action
= Actions.Table.GET_BROKER)
+ @ApiOperation(value = "List brokers for a given table", notes = "List
brokers for a given table")
+ public List<InstanceInfo> getBrokersForTableV2(
+ @ApiParam(value = "Name of the table", required = true)
@PathParam("tableName") String tableName,
+ @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String
tableTypeStr,
+ @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state) {
try {
List<String> tableNamesWithType = _pinotHelixResourceManager
.getExistingTableNamesWithType(tableName,
Constants.validateTableType(tableTypeStr));
@@ -146,8 +231,25 @@ public class PinotBrokerRestletResource implements
PinotBrokerService {
}
}
- @Override
- public SuccessResponse toggleQueryRateLimiting(String brokerInstanceName,
String state) {
+ @POST
+ @Path("/brokers/instances/{instanceName}/qps")
+ @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.UPDATE_QPS)
+ @Authenticate(AccessType.UPDATE)
+ @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_")) {
throw new ControllerApplicationException(LOGGER,
String.format("'%s' is not a valid broker instance name.",
brokerInstanceName), Response.Status.BAD_REQUEST);
diff --git
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/services/PinotBrokerService.java
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/services/PinotBrokerService.java
deleted file mode 100644
index 874a62b4ad..0000000000
---
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/services/PinotBrokerService.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.pinot.controller.api.services;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiKeyAuthDefinition;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import io.swagger.annotations.Authorization;
-import io.swagger.annotations.SecurityDefinition;
-import io.swagger.annotations.SwaggerDefinition;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import org.apache.pinot.controller.api.access.AccessType;
-import org.apache.pinot.controller.api.access.Authenticate;
-import org.apache.pinot.controller.api.resources.Constants;
-import org.apache.pinot.controller.api.resources.InstanceInfo;
-import org.apache.pinot.controller.api.resources.SuccessResponse;
-import org.apache.pinot.core.auth.Actions;
-import org.apache.pinot.core.auth.Authorize;
-import org.apache.pinot.core.auth.TargetType;
-import org.apache.pinot.spi.utils.CommonConstants;
-
-
-/**
- * The interface defining the broker instance operations in Pinot Controller
- */
-@Api(tags = Constants.BROKER_TAG, authorizations = {@Authorization(value =
CommonConstants.SWAGGER_AUTHORIZATION_KEY)})
-@SwaggerDefinition(securityDefinition = @SecurityDefinition(
- apiKeyAuthDefinitions = @ApiKeyAuthDefinition(
- name = HttpHeaders.AUTHORIZATION,
- in = ApiKeyAuthDefinition.ApiKeyLocation.HEADER,
- key = CommonConstants.SWAGGER_AUTHORIZATION_KEY)))
-@Path("/")
-public interface PinotBrokerService {
-
- /**
- * List tenants and tables to brokers mappings
- * @param state whether the broker is online or offline
- * @return the Map of tenants and tables to brokers mappings
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/brokers")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tenants and tables to brokers mappings",
- notes = "List tenants and tables to brokers mappings")
- Map<String, Map<String, List<String>>> listBrokersMapping(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List tenants to brokers mappings
- * @param state whether the brokers are online or offline
- * @return the map of tenants to brokers mappings
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/brokers/tenants")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tenants to brokers mappings", notes = "List
tenants to brokers mappings")
- Map<String, List<String>> getTenantsToBrokersMapping(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List brokers for a given tenant
- * @param tenantName Name of the tenant
- * @param state whether the brokers are online or offline
- * @return brokers for a given tenant
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/brokers/tenants/{tenantName}")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List brokers for a given tenant", notes = "List
brokers for a given tenant")
- List<String> getBrokersForTenant(
- @ApiParam(value = "Name of the tenant", required = true)
@PathParam("tenantName") String tenantName,
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List tables to brokers mappings
- * @param state whether the brokers are online or offline
- * @return tables to brokers mapping
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/brokers/tables")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tables to brokers mappings", notes = "List
tables to brokers mappings")
- Map<String, List<String>> getTablesToBrokersMapping(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List brokers for a given table
- * @param tableName Name of the table
- * @param tableTypeStr Whether table is OFFLINE or REALTIME
- * @param state whether the brokers are online or offline
- * @return brokers for a given table
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/brokers/tables/{tableName}")
- @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action =
Actions.Table.GET_BROKER)
- @ApiOperation(value = "List brokers for a given table", notes = "List
brokers for a given table")
- List<String> getBrokersForTable(
- @ApiParam(value = "Name of the table", required = true)
@PathParam("tableName") String tableName,
- @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String
tableTypeStr,
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List tenants and tables to brokers mappings
- * @param state whether the brokers are online or offline
- * @return tenants and tables to brokers mappings
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/v2/brokers")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tenants and tables to brokers mappings",
- notes = "List tenants and tables to brokers mappings")
- Map<String, Map<String, List<InstanceInfo>>> listBrokersMappingV2(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List tenants to brokers mappings
- * @param state whether the brokers are online or offline
- * @return tenants to brokers mappings
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/v2/brokers/tenants")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tenants to brokers mappings", notes = "List
tenants to brokers mappings")
- Map<String, List<InstanceInfo>> getTenantsToBrokersMappingV2(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List brokers for a given tenant
- * @param tenantName Name of the tenant
- * @param state whether the brokers are online or offline
- * @return brokers for a given tenant
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/v2/brokers/tenants/{tenantName}")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List brokers for a given tenant", notes = "List
brokers for a given tenant")
- List<InstanceInfo> getBrokersForTenantV2(
- @ApiParam(value = "Name of the tenant", required = true)
@PathParam("tenantName") String tenantName,
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List tables to brokers mappings
- * @param state whether the brokers are online or offline
- * @return tables to brokers mappings
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/v2/brokers/tables")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.GET_BROKER)
- @ApiOperation(value = "List tables to brokers mappings", notes = "List
tables to brokers mappings")
- Map<String, List<InstanceInfo>> getTablesToBrokersMappingV2(
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * List brokers for a given table
- * @param tableName Name of the table
- * @param tableTypeStr wheter the table is OFFLINE or REALTIME
- * @param state whether the brokers are online or offline
- * @return brokers for a given table
- */
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- @Path("/v2/brokers/tables/{tableName}")
- @Authorize(targetType = TargetType.CLUSTER, paramName = "tableName", action
= Actions.Table.GET_BROKER)
- @ApiOperation(value = "List brokers for a given table", notes = "List
brokers for a given table")
- List<InstanceInfo> getBrokersForTableV2(
- @ApiParam(value = "Name of the table", required = true)
@PathParam("tableName") String tableName,
- @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String
tableTypeStr,
- @ApiParam(value = "ONLINE|OFFLINE") @QueryParam("state") String state);
-
- /**
- * Enable/disable the query rate limiting for a broker instance
- * @param brokerInstanceName Broker instance name
- * @param state whether the brokers are online or offline
- * @return {@link org.apache.pinot.controller.api.resources.SuccessResponse}
object indicating the operation results
- */
- @POST
- @Path("/brokers/instances/{instanceName}/qps")
- @Authorize(targetType = TargetType.CLUSTER, action =
Actions.Cluster.UPDATE_QPS)
- @Authenticate(AccessType.UPDATE)
- @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")
- })
- 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);
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]