deepthi912 commented on code in PR #13296: URL: https://github.com/apache/pinot/pull/13296#discussion_r1635374831
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -230,25 +231,54 @@ public List<Map<TableType, List<String>>> getSegments( @Path("segments/{tableName}/servers") @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.GET_SERVER_MAP) @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get a map from server to segments hosted by the server", - notes = "Get a map from server to segments hosted by the server") + @ApiOperation(value = "Get a map from server to segments hosted by the server", notes = "Get a map from server to " + + "segments hosted by the server") public List<Map<String, Object>> getServerToSegmentsMap( @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName, - @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr, @Context HttpHeaders headers) { + @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr, + @QueryParam("detailed") @DefaultValue("true") boolean detailed, @Context HttpHeaders headers) { tableName = DatabaseUtils.translateTableName(tableName, headers); - List<String> tableNamesWithType = ResourceUtils - .getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, Constants.validateTableType(tableTypeStr), - LOGGER); + List<String> tableNamesWithType = ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, tableName, + Constants.validateTableType(tableTypeStr), LOGGER); List<Map<String, Object>> resultList = new ArrayList<>(tableNamesWithType.size()); for (String tableNameWithType : tableNamesWithType) { Map<String, Object> resultForTable = new LinkedHashMap<>(); resultForTable.put("tableName", tableNameWithType); - resultForTable.put("serverToSegmentsMap", _pinotHelixResourceManager.getServerToSegmentsMap(tableNameWithType)); + if (detailed) { + resultForTable.put("serverToSegmentsMap", _pinotHelixResourceManager.getServerToSegmentsMap(tableNameWithType)); + } else { + resultForTable.put("serverToSegmentsCountMap", + _pinotHelixResourceManager.getServerToSegmentsCountMap(tableNameWithType)); + } resultList.add(resultForTable); } return resultList; } + @GET + @Produces(MediaType.APPLICATION_JSON) + @Path("/segments/{tableName}/info") Review Comment: Yeah that was my plan too but Tableviews looked more of like the changes related to table.. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org