Skip to content

Commit

Permalink
[HUDI-2248] Fixing the closing of hms client (#3364)
Browse files Browse the repository at this point in the history
* [HUDI-2248] Fixing the closing of hms client

* [HUDI-2248] Using Hive.closeCurrent() over client.close()
  • Loading branch information
jsbali authored Sep 23, 2021
1 parent b4b23e4 commit f52cb32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void close() {
if (lock != null) {
hiveClient.unlock(lock.getLockid());
}
hiveClient.close();
Hive.closeCurrent();
} catch (Exception e) {
LOG.error(generateLogStatement(org.apache.hudi.common.lock.LockState.FAILED_TO_RELEASE, generateLogSuffixString()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void close() {
try {
ddlExecutor.close();
if (client != null) {
client.close();
Hive.closeCurrent();
client = null;
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.hadoop.hive.metastore.RetryingMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.ql.metadata.Hive;
import org.apache.hive.service.server.HiveServer2;
import org.apache.parquet.avro.AvroSchemaConverter;
import org.apache.parquet.hadoop.ParquetWriter;
Expand Down Expand Up @@ -265,7 +266,7 @@ public void startHiveServer2() {

public void shutDown() {
stopHiveServer2();
client.close();
Hive.closeCurrent();
hiveTestService.getHiveMetaStore().stop();
hdfsTestService.stop();
}
Expand Down

0 comments on commit f52cb32

Please sign in to comment.