Jackie-Jiang commented on code in PR #14544: URL: https://github.com/apache/pinot/pull/14544#discussion_r1861272093
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -678,6 +699,81 @@ public SuccessResponse reloadAllSegments( return new SuccessResponse(JsonUtils.objectToString(perTableMsgData)); } + @POST + @Path("segments/{tableName}/batchReload") + @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.RELOAD_SEGMENT) + @Authenticate(AccessType.UPDATE) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Reload with a map from instances to segments for more flexible control", notes = "Reload " + + "with a map from instances to segments for more flexible control") + public SuccessResponse reloadSegments( + @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName, + @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr, + @ApiParam(value = "Whether to force server to download segment") @QueryParam("forceDownload") + @DefaultValue("false") boolean forceDownload, + @ApiParam(value = "Map from instances to segments to reload", required = true) @QueryParam("reloadMap") Review Comment: Consider also allowing reloading a list of segments by adding a `segments` query parameter ########## pinot-server/src/main/java/org/apache/pinot/server/api/resources/ControllerJobStatusResource.java: ########## @@ -51,45 +54,32 @@ public class ControllerJobStatusResource { @ApiOperation(value = "Task status", notes = "Return the status of a given reload job") public String reloadJobStatus(@PathParam("tableNameWithType") String tableNameWithType, @QueryParam("reloadJobTimestamp") long reloadJobSubmissionTimestamp, - @QueryParam("segmentName") String segmentName, - @Context HttpHeaders headers) + @QueryParam("segmentNames") String segmentNames, @Context HttpHeaders headers) Review Comment: This is backward incompatible. Let's just keep the param as is ########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -678,6 +699,81 @@ public SuccessResponse reloadAllSegments( return new SuccessResponse(JsonUtils.objectToString(perTableMsgData)); } + @POST + @Path("segments/{tableName}/batchReload") + @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.RELOAD_SEGMENT) + @Authenticate(AccessType.UPDATE) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Reload with a map from instances to segments for more flexible control", notes = "Reload " + + "with a map from instances to segments for more flexible control") + public SuccessResponse reloadSegments( + @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") String tableName, + @ApiParam(value = "OFFLINE|REALTIME") @QueryParam("type") String tableTypeStr, + @ApiParam(value = "Whether to force server to download segment") @QueryParam("forceDownload") + @DefaultValue("false") boolean forceDownload, + @ApiParam(value = "Map from instances to segments to reload", required = true) @QueryParam("reloadMap") Review Comment: Suggest renaming it to `instanceToSegmentsMap` to be more specific ########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java: ########## @@ -678,6 +699,81 @@ public SuccessResponse reloadAllSegments( return new SuccessResponse(JsonUtils.objectToString(perTableMsgData)); } + @POST + @Path("segments/{tableName}/batchReload") + @Authorize(targetType = TargetType.TABLE, paramName = "tableName", action = Actions.Table.RELOAD_SEGMENT) + @Authenticate(AccessType.UPDATE) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Reload with a map from instances to segments for more flexible control", notes = "Reload " + + "with a map from instances to segments for more flexible control") + public SuccessResponse reloadSegments( Review Comment: Consider integrating this into the table reload API (`POST segments/{tableName}/reload`) -- 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