sajjad-moradi commented on code in PR #9006:
URL: https://github.com/apache/pinot/pull/9006#discussion_r911522746


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java:
##########
@@ -652,6 +652,29 @@ public Response endReplaceSegments(
     }
   }
 
+  @GET
+  @Path("segments/{tableName}/listSegmentLineage")
+  @Authenticate(AccessType.READ)
+  @Produces(MediaType.APPLICATION_JSON)
+  @ApiOperation(value = "List segment lineage", notes = "List segment lineage")
+  public Response listSegmentLineage(
+      @ApiParam(value = "Name of the table", required = true) 
@PathParam("tableName") String tableName,
+      @ApiParam(value = "OFFLINE|REALTIME", required = true) 
@QueryParam("type") String tableTypeStr) {
+    TableType tableType = Constants.validateTableType(tableTypeStr);
+    if (tableType == null) {
+      throw new ControllerApplicationException(LOGGER, "Table type should 
either be offline or realtime",
+          Response.Status.BAD_REQUEST);
+    }
+    try {
+      String tableNameWithType =
+          
ResourceUtils.getExistingTableNamesWithType(_pinotHelixResourceManager, 
tableName, tableType, LOGGER).get(0);

Review Comment:
   I think this already throws 404 if the table is not there. You can move it 
outside the try-catch and change the error in the catch block for generic 
exception to 500.



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

Reply via email to