xxubai commented on code in PR #4278:
URL: https://github.com/apache/amoro/pull/4278#discussion_r3637835222
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/formats/iceberg/utils/RollingFileCleaner.java:
##########
@@ -110,27 +113,34 @@ private void doCleanFiles() {
}
}
}
- // Try to delete empty parent directories. Skipped automatically by
- // TableFileUtil.deleteEmptyDirectory when the underlying FileIO is an
object store.
- if (fileIO.supportFileSystemOperations()) {
- for (String parentDir : parentDirectories) {
- try {
- TableFileUtil.deleteEmptyDirectory(fileIO, parentDir,
excludeFiles);
- } catch (Exception e) {
- LOG.warn("Failed to delete empty parent directory: {}", parentDir,
e);
- }
- }
- }
LOG.debug("Cleaned expired a file group, total files: {}",
collectedFiles.size());
} finally {
- // Always drop both buffers so a failure in directory cleanup does not
cause the
- // already-deleted files to be re-submitted on the next batch.
- parentDirectories.clear();
collectedFiles.clear();
}
}
+ public void doCleanParentDirectory() {
Review Comment:
nit: can you limit the method scope? such as `private`
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/formats/iceberg/utils/RollingFileCleaner.java:
##########
@@ -110,27 +113,34 @@ private void doCleanFiles() {
}
}
}
- // Try to delete empty parent directories. Skipped automatically by
- // TableFileUtil.deleteEmptyDirectory when the underlying FileIO is an
object store.
- if (fileIO.supportFileSystemOperations()) {
- for (String parentDir : parentDirectories) {
- try {
- TableFileUtil.deleteEmptyDirectory(fileIO, parentDir,
excludeFiles);
- } catch (Exception e) {
- LOG.warn("Failed to delete empty parent directory: {}", parentDir,
e);
- }
- }
- }
LOG.debug("Cleaned expired a file group, total files: {}",
collectedFiles.size());
} finally {
- // Always drop both buffers so a failure in directory cleanup does not
cause the
- // already-deleted files to be re-submitted on the next batch.
- parentDirectories.clear();
collectedFiles.clear();
}
}
+ public void doCleanParentDirectory() {
Review Comment:
nit: can you limit the method scope? such as `private`
--
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]