okumin commented on code in PR #4444:
URL: https://github.com/apache/hive/pull/4444#discussion_r1238739704
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -5700,11 +5701,26 @@ public HiveMetaHook getHook(
}
};
- if (conf.getBoolVar(ConfVars.METASTORE_FASTPATH)) {
- return new SessionHiveMetaStoreClient(conf, hookLoader, allowEmbedded);
- } else {
- return RetryingMetaStoreClient.getProxy(conf, hookLoader,
metaCallTimeMap,
- SessionHiveMetaStoreClient.class.getName(), allowEmbedded);
+ return createMetaStoreClientFactory(conf)
+ .createMetaStoreClient(conf, hookLoader, allowEmbedded,
metaCallTimeMap);
+ }
+
+ private static HiveMetaStoreClientFactory
createMetaStoreClientFactory(HiveConf conf) throws
+ MetaException {
+ String metaStoreClientFactoryClassName = MetastoreConf.getVar(conf,
+ MetastoreConf.ConfVars.METASTORE_CLIENT_FACTORY_CLASS);
Review Comment:
Thanks. I think there are 3 existing patterns.
- `hive.metastore.fastpath=true` and `metastore.client.class` is default
- We use `SessionHiveMetaStoreClient` without `RetryingMetaStoreClient`
- `hive.metastore.fastpath=false` and `metastore.client.class` is default
- We use `SessionHiveMetaStoreClient` with `RetryingMetaStoreClient`
- `hive.metastore.fastpath=false` and `metastore.client.class` is a custom
one
- We use the custom client without `RetryingMetaStoreClient`.
`RetryingMetaStoreClient` is tightly coupled with Thrift-based
`SessionHiveMetaStoreClient`
I have not come up with a very smart way to resolve the combination... It
could be likely to be like this but I'd say there is a better way.
```
String className = MetastoreConf.getVar(conf,
MetastoreConf.ConfVars.METASTORE_CLIENT_FACTORY_CLASS);
if (conf.getBoolVar(ConfVars.METASTORE_FASTPATH) || className !=
"SessionHiveMetaStoreClient") {
return HiveMetaStoreClientFactory.create(...);
} else {
return RetryingMetaStoreClient.getProxy(conf, hookLoader, metaCallTimeMap,
SessionHiveMetaStoreClient.class.getName(), allowEmbedded);
}
```
--
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]