You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/06/30 14:12:29 UTC

[GitHub] [iceberg] pvary commented on a diff in pull request #5166: HiveCatalog: Close resources underlying various classes

pvary commented on code in PR #5166:
URL: https://github.com/apache/iceberg/pull/5166#discussion_r911078152


##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopFileIO.java:
##########
@@ -73,8 +73,7 @@ public OutputFile newOutputFile(String path) {
   @Override
   public void deleteFile(String path) {
     Path toDelete = new Path(path);
-    FileSystem fs = Util.getFs(toDelete, hadoopConf.get());
-    try {
+    try (FileSystem fs = Util.getFs(toDelete, hadoopConf.get())) {

Review Comment:
   This will remove the FileSystem from the cache.
   If we delete multiple files on S3, closing the FS every time will become costly



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org