Jackie-Jiang commented on code in PR #17197:
URL: https://github.com/apache/pinot/pull/17197#discussion_r2566637531


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentRestletResource.java:
##########
@@ -466,6 +466,89 @@ public SuccessResponse resetSegments(
     }
   }
 
+  @POST
+  @Path("segments/{tableNameWithType}/uploadFromServerToDeepstore")
+  @Authorize(targetType = TargetType.TABLE, paramName = "tableNameWithType", 
action = Actions.Table.UPLOAD_SEGMENT)
+  @Authenticate(AccessType.UPDATE)
+  @Produces(MediaType.APPLICATION_JSON)
+  @ApiOperation(value = "Upload realtime segments from server to deep store",
+      notes = "Uploads realtime segments from servers (with online replicas) 
to deep store. "
+          + "When forceMode=false (default), only uploads segments missing 
from deep store. "
+          + "When forceMode=true, bypasses all checks and reuploads segments 
even if they already exist.")
+  @ApiResponses(value = {
+      @ApiResponse(code = 200, message = "Success"),
+      @ApiResponse(code = 400, message = "Bad request - table must be a 
realtime table"),
+      @ApiResponse(code = 404, message = "Table not found"),
+      @ApiResponse(code = 500, message = "Internal server error")
+  })
+  public SuccessResponse uploadFromServerToDeepstore(
+      @ApiParam(value = "Name of the realtime table with type", required = 
true, example = "myTable_REALTIME")
+      @PathParam("tableNameWithType") String tableNameWithType,
+      @ApiParam(value = "List of segment names to upload. If not provided, 
uploads all segments.",
+          allowMultiple = true) @QueryParam("segmentNames") @Nullable 
List<String> segmentNames,
+      @ApiParam(value = "Force mode: when true, bypasses checks and reuploads 
even if segments exist in deep store",
+          defaultValue = "false") @QueryParam("forceMode") 
@DefaultValue("false") boolean forceMode,

Review Comment:
   We usually call it `force`, e.g. in schema upload etc.



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

Reply via email to