chenboat commented on a change in pull request #7556:
URL: https://github.com/apache/pinot/pull/7556#discussion_r728650171
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableInstances.java
##########
@@ -113,4 +114,45 @@ public String getTableInstances(
ret.set("server", servers); // Keeping compatibility with previous API,
so "server" and "brokers"
return ret.toString();
}
+
+ @GET
+ @Path("/tables/{tableName}/brokers")
+ @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 String getTableBrokers(
+ @ApiParam(value = "Table name without type", required = true)
@PathParam("tableName") String tableName) {
+ ObjectNode ret = JsonUtils.newObjectNode();
Review comment:
I think we should make this API to return as close to what the zookeeper
stores as possible. Today the zk stores one typed table entries. It is better
to returns the typed table entries as well. In this way this API can serve
multiple purposes than just querying routing. For example, one may even use it
to detect if there is any problem with hybrid table's broker assignment. We can
leave it to the client to do what they want to do with the returned results --
they can do intersection if they want to.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]