akshat0395 commented on code in PR #4418:
URL: https://github.com/apache/hive/pull/4418#discussion_r1229981943
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/dataconnector/DataConnectorProviderFactory.java:
##########
@@ -89,19 +110,23 @@ public static synchronized IDataConnectorProvider
getDataConnectorProvider(Datab
default:
throw new MetaException("Data connector of type " + connector.getType()
+ " not implemented yet");
}
- cache.put(connector.getName().toLowerCase(), provider);
+ dataConnectorCache.put(connector.getName().toLowerCase(), provider);
return provider;
}
- public void shutdown() {
- for (IDataConnectorProvider provider: cache.values()) {
- try {
- provider.close();
- } catch(Exception e) {
- LOG.warn("Exception invoking close on dataconnectorprovider:" +
provider, e);
- } finally {
- cache.clear();
+ /**
+ * After executing Drop or Alter DDL on a dataConnector, we should update
cache to clean the dataConnector
+ * to avoid using the invalid dataConnector next time.
+ * @param dcName dataConnector to be cleaned
+ */
+ public static synchronized void updateDataConnectorCache(String dcName) {
Review Comment:
As this method is serving specific case of case of invalidation of cache,
can this be renamed to invaidateDataConnectorFromCache?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]