Skip to content

Commit

Permalink
Revert "Hive: close the fileIO client when closing the hive catalog (a…
Browse files Browse the repository at this point in the history
…pache#10771)" (apache#11858)

This reverts commit 7e2920a.
  • Loading branch information
Fokko authored Dec 30, 2024
1 parent 7f14032 commit e3f50e5
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -92,7 +90,6 @@ public class HiveCatalog extends BaseMetastoreViewCatalog
private ClientPool<IMetaStoreClient, TException> clients;
private boolean listAllTables = false;
private Map<String, String> catalogProperties;
private FileIOTracker fileIOTracker;

public HiveCatalog() {}

Expand Down Expand Up @@ -125,7 +122,6 @@ public void initialize(String inputName, Map<String, String> properties) {
: CatalogUtil.loadFileIO(fileIOImpl, properties, conf);

this.clients = new CachedClientPool(conf, properties);
this.fileIOTracker = new FileIOTracker();
}

@Override
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -798,14 +791,6 @@ protected Map<String, String> 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;
Expand Down

0 comments on commit e3f50e5

Please sign in to comment.