in kyuubi-relocated-hive-metastore-client/src/main/java/org/apache/kyuubi/shaded/hive/metastore/HiveMetaStoreClient.java [683:710]
public void close() {
isConnected = false;
currentMetaVars = null;
try {
if (null != client) {
client.shutdown();
if ((transport == null) || !transport.isOpen()) {
final int newCount = connCount.decrementAndGet();
LOG.info("Closed a connection to metastore, current connections: {}", newCount);
}
}
} catch (TException e) {
LOG.debug("Unable to shutdown metastore client. Will try closing transport directly.", e);
}
// Transport would have got closed via client.shutdown(), so we dont need this, but
// just in case, we make this call.
if ((transport != null) && transport.isOpen()) {
transport.close();
final int newCount = connCount.decrementAndGet();
LOG.info("Closed a connection to metastore, current connections: {}", newCount);
if (LOG.isTraceEnabled()) {
LOG.trace(
"METASTORE CONNECTION TRACE - close [{}]",
System.identityHashCode(this),
new Exception());
}
}
}