Jackie-Jiang commented on code in PR #17294:
URL: https://github.com/apache/pinot/pull/17294#discussion_r2688718341
##########
pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java:
##########
@@ -81,11 +81,33 @@ public boolean mkdir(URI uri)
@Override
public boolean delete(URI segmentUri, boolean forceDelete)
throws IOException {
- // Returns false if we are moving a directory and that directory is not
empty
+ Path path = new Path(segmentUri);
+
+ if (!_hadoopFS.exists(path)) {
+ return true;
+ }
+
if (isDirectory(segmentUri) && listFiles(segmentUri, false).length > 0 &&
!forceDelete) {
return false;
}
- return _hadoopFS.delete(new Path(segmentUri), true);
+
+ return _hadoopFS.delete(path, true);
+ }
+
+ @Override
+ public boolean deleteBatch(List<URI> segmentUris, boolean forceDelete)
+ throws IOException {
+ if (segmentUris == null || segmentUris.isEmpty()) {
+ return true;
+ }
+
+ boolean result = true;
+ for (URI segmentUri : segmentUris) {
+ if (!delete(segmentUri, forceDelete)) {
+ result = false;
+ }
+ }
+ return result;
Review Comment:
Seems we don't need this override
--
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]