From e3f50e5c62d01f3f31239d197ef281fc36cf31fa Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Mon, 30 Dec 2024 22:04:36 +0100 Subject: [PATCH] Revert "Hive: close the fileIO client when closing the hive catalog (#10771)" (#11858) This reverts commit 7e2920af400e5d559f8f1742b1043787b0477d74. --- .../org/apache/iceberg/hive/HiveCatalog.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java b/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java index 9fd7c6f2eeb0..89e79c8c4722 100644 --- a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java +++ b/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java @@ -18,7 +18,6 @@ */ package org.apache.iceberg.hive; -import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; @@ -53,7 +52,6 @@ import org.apache.iceberg.exceptions.NotFoundException; import org.apache.iceberg.hadoop.HadoopFileIO; import org.apache.iceberg.io.FileIO; -import org.apache.iceberg.io.FileIOTracker; import org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting; import org.apache.iceberg.relocated.com.google.common.base.MoreObjects; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; @@ -92,7 +90,6 @@ public class HiveCatalog extends BaseMetastoreViewCatalog private ClientPool clients; private boolean listAllTables = false; private Map catalogProperties; - private FileIOTracker fileIOTracker; public HiveCatalog() {} @@ -125,7 +122,6 @@ public void initialize(String inputName, Map properties) { : CatalogUtil.loadFileIO(fileIOImpl, properties, conf); this.clients = new CachedClientPool(conf, properties); - this.fileIOTracker = new FileIOTracker(); } @Override @@ -666,10 +662,7 @@ private boolean isValidateNamespace(Namespace namespace) { public TableOperations newTableOps(TableIdentifier tableIdentifier) { String dbName = tableIdentifier.namespace().level(0); String tableName = tableIdentifier.name(); - HiveTableOperations ops = - new HiveTableOperations(conf, clients, fileIO, name, dbName, tableName); - fileIOTracker.track(ops); - return ops; + return new HiveTableOperations(conf, clients, fileIO, name, dbName, tableName); } @Override @@ -798,14 +791,6 @@ protected Map properties() { return catalogProperties == null ? ImmutableMap.of() : catalogProperties; } - @Override - public void close() throws IOException { - super.close(); - if (fileIOTracker != null) { - fileIOTracker.close(); - } - } - @VisibleForTesting void setListAllTables(boolean listAllTables) { this.listAllTables = listAllTables;