Jackie-Jiang commented on a change in pull request #6426: URL: https://github.com/apache/incubator-pinot/pull/6426#discussion_r554173650
########## File path: pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java ########## @@ -204,7 +205,7 @@ public boolean delete(URI segmentUri, boolean forceDelete) throws IOException { LOGGER.info("Deleting uri {} force {}", segmentUri, forceDelete); try { if (!exists(segmentUri)) { - return false; + return forceDelete; Review comment: Should we return `true` here? ########## File path: pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java ########## @@ -313,8 +314,12 @@ public long length(URI fileUri) throws IOException { } page.iterateAll() .forEach(blob -> { - if (!blob.getName().equals(fileUri.getPath())) { - builder.add(blob.getName()); + if (!blob.getName().equals(prefix)) { + try { + builder.add(new URI(SCHEME, fileUri.getHost(), DELIMITER + blob.getName(), null).toString()); Review comment: Why do we need to recreate the uri? ########## File path: pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java ########## @@ -130,7 +131,7 @@ private String sanitizePath(String path) { private URI getBase(URI uri) throws IOException { try { - return new URI(uri.getScheme(), uri.getHost(), null, null); + return new URI(SCHEME, uri.getHost(), DELIMITER, null); Review comment: Is the third argument `path`? It is a little bit confusing to put delimiter as the path ########## File path: pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java ########## @@ -204,7 +205,7 @@ public boolean delete(URI segmentUri, boolean forceDelete) throws IOException { LOGGER.info("Deleting uri {} force {}", segmentUri, forceDelete); try { if (!exists(segmentUri)) { - return false; + return forceDelete; } if (isDirectory(segmentUri)) { if (!forceDelete) { Review comment: If directory is not empty, it should return `false` instead of throwing exception ---------------------------------------------------------------- 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