Aravind-Suresh commented on code in PR #11183: URL: https://github.com/apache/pinot/pull/11183#discussion_r1281375112
########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotRealtimeTableResource.java: ########## @@ -104,6 +110,70 @@ public Response pauseConsumption( } } + @POST + @Produces(MediaType.APPLICATION_JSON) + @Path("/tables/{tableName}/reload") + @ApiOperation(value = "Reloads the table across all the servers", notes = "This would reconstruct the table data" + + "manager in case of configuration changes. Example usage: trigger after converting the upsert mode" + + "from full to partial.") + public SuccessResponse reloadTable( + @ApiParam(value = "Name of the table", required = true) @PathParam("tableName") @Nullable + String tableName, + @ApiParam(value = "Whether to force the reload (if table config is not updated, reload will not be done)") + @QueryParam("force") boolean force, + @Context HttpHeaders httpHeaders, @Context Request request) { + String tableNameWithType = TableNameBuilder.REALTIME.tableNameWithType(tableName); + validate(tableNameWithType); + // checking if another reload job exists + // if so, fail the request with the ongoing reload job's id + Map<String, Map<String, String>> reloadJobs = + _pinotHelixResourceManager.getAllJobsForTable(tableNameWithType, + Collections.singleton(ControllerJobType.RELOAD_TABLE)); + if (reloadJobs.size() > 0) { + String jobId = reloadJobs.keySet().iterator().next(); Review Comment: Removed it - thought of avoiding multiple reload jobs at the same time. But looks like it's not possible at the moment because these controller jobs do not have state associated and as you said this gives all the historical + current jobs. So, removed this validation. -- 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