fx19880617 commented on a change in pull request #5967:
URL: https://github.com/apache/incubator-pinot/pull/5967#discussion_r496974735



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java
##########
@@ -460,6 +465,40 @@ public void uploadSegmentAsMultiPartV2(FormDataMultiPart 
multiPart,
     }
   }
 
+  @POST
+  @ManagedAsync
+  @Produces(MediaType.APPLICATION_JSON)
+  @Consumes(MediaType.APPLICATION_JSON)
+  @Path("/segments/metadata")
+  @ApiOperation(value = "Upload a segment with metadata", notes = "Upload a 
segment using segment metadata")
+  public void uploadSegmentMetadataAsJson(String segmentJsonStr,
+      @ApiParam(value = "Name of the table") 
@QueryParam(FileUploadDownloadClient.QueryParameters.TABLE_NAME) String 
tableName,
+      @ApiParam(value = "Whether to enable parallel push protection") 
@DefaultValue("false") 
@QueryParam(FileUploadDownloadClient.QueryParameters.ENABLE_PARALLEL_PUSH_PROTECTION)
 boolean enableParallelPushProtection,
+      @Context HttpHeaders headers, @Context Request request, @Suspended final 
AsyncResponse asyncResponse) {
+    try {
+      asyncResponse.resume(uploadSegment(tableName, null, 
enableParallelPushProtection, headers, request, false));
+    } catch (Throwable t) {
+      asyncResponse.resume(t);
+    }
+  }
+
+  @POST
+  @ManagedAsync
+  @Produces(MediaType.APPLICATION_JSON)
+  @Consumes(MediaType.MULTIPART_FORM_DATA)
+  @Path("/segments/metadata")
+  @ApiOperation(value = "Upload a segment with metadata", notes = "Upload a 
segment using segment metadata")
+  public void uploadSegmentMetadataAsMultiPart(FormDataMultiPart multiPart,
+      @ApiParam(value = "Name of the table") 
@QueryParam(FileUploadDownloadClient.QueryParameters.TABLE_NAME) String 
tableName,
+      @ApiParam(value = "Whether to enable parallel push protection") 
@DefaultValue("false") 
@QueryParam(FileUploadDownloadClient.QueryParameters.ENABLE_PARALLEL_PUSH_PROTECTION)
 boolean enableParallelPushProtection,
+      @Context HttpHeaders headers, @Context Request request, @Suspended final 
AsyncResponse asyncResponse) {
+    try {
+      asyncResponse.resume(uploadSegment(tableName, multiPart, 
enableParallelPushProtection, headers, request, false));
+    } catch (Throwable t) {
+      asyncResponse.resume(t);
+    }
+  }
+

Review comment:
       make sense.




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

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

Reply via email to