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 2022/02/17 22:32:22 UTC

[GitHub] [pinot] ankitsultana commented on a change in pull request #8188: Add Support for Getting Live Brokers for a Table (without type suffix)

ankitsultana commented on a change in pull request #8188:
URL: https://github.com/apache/pinot/pull/8188#discussion_r809523004



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableInstances.java
##########
@@ -116,16 +121,42 @@ public String getTableInstances(
   }
 
   @GET
-  @Path("/tables/{tableNameWithType}/livebrokers")
+  @Path("/tables/{tableName}/livebrokers")
   @Produces(MediaType.APPLICATION_JSON)
   @ApiOperation(value = "List the brokers serving a table", notes = "List live brokers of the given table based on EV")
   @ApiResponses(value = {
       @ApiResponse(code = 200, message = "Success"),
       @ApiResponse(code = 404, message = "Table not found"),
       @ApiResponse(code = 500, message = "Internal server error")})
   public List<String> getLiveBrokersForTable(
-      @ApiParam(value = "Table name with type", required = true)
-      @PathParam("tableNameWithType") String tableNameWithType) {
-    return _pinotHelixResourceManager.getLiveBrokersForTable(tableNameWithType);
+      @ApiParam(value = "Table name (with or without type)", required = true)
+      @PathParam("tableName") String tableName) {
+    if (TableNameBuilder.getTableTypeFromTableName(tableName) != null) {
+      return _pinotHelixResourceManager.getLiveBrokersForTable(tableName);

Review comment:
       I see that some methods in `PinotHelixResourceManager` use `tableName` and some use `tableNameWithType` so in that sense it should be fine. Pushing it down to `PinotHelixResourceManager` would allow other callers of this method to avoid having to duplicate the logic the API is doing, so that's a positive. I'll update.




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

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

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