[HUDI-2248] Fixing the closing of hms client (#3364)
* [HUDI-2248] Fixing the closing of hms client * [HUDI-2248] Using Hive.closeCurrent() over client.close()
This commit is contained in:
@@ -149,7 +149,7 @@ public class HiveMetastoreBasedLockProvider implements LockProvider<LockResponse
|
|||||||
if (lock != null) {
|
if (lock != null) {
|
||||||
hiveClient.unlock(lock.getLockid());
|
hiveClient.unlock(lock.getLockid());
|
||||||
}
|
}
|
||||||
hiveClient.close();
|
Hive.closeCurrent();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error(generateLogStatement(org.apache.hudi.common.lock.LockState.FAILED_TO_RELEASE, generateLogSuffixString()));
|
LOG.error(generateLogStatement(org.apache.hudi.common.lock.LockState.FAILED_TO_RELEASE, generateLogSuffixString()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ public class HoodieHiveClient extends AbstractSyncHoodieClient {
|
|||||||
try {
|
try {
|
||||||
ddlExecutor.close();
|
ddlExecutor.close();
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
client.close();
|
Hive.closeCurrent();
|
||||||
client = null;
|
client = null;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import org.apache.hadoop.hive.metastore.IMetaStoreClient;
|
|||||||
import org.apache.hadoop.hive.metastore.RetryingMetaStoreClient;
|
import org.apache.hadoop.hive.metastore.RetryingMetaStoreClient;
|
||||||
import org.apache.hadoop.hive.metastore.api.Database;
|
import org.apache.hadoop.hive.metastore.api.Database;
|
||||||
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
|
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.hive.service.server.HiveServer2;
|
||||||
import org.apache.parquet.avro.AvroSchemaConverter;
|
import org.apache.parquet.avro.AvroSchemaConverter;
|
||||||
import org.apache.parquet.hadoop.ParquetWriter;
|
import org.apache.parquet.hadoop.ParquetWriter;
|
||||||
@@ -265,7 +266,7 @@ public class TestCluster implements BeforeAllCallback, AfterAllCallback,
|
|||||||
|
|
||||||
public void shutDown() {
|
public void shutDown() {
|
||||||
stopHiveServer2();
|
stopHiveServer2();
|
||||||
client.close();
|
Hive.closeCurrent();
|
||||||
hiveTestService.getHiveMetaStore().stop();
|
hiveTestService.getHiveMetaStore().stop();
|
||||||
hdfsTestService.stop();
|
hdfsTestService.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user