deniskuzZ commented on code in PR #6499:
URL: https://github.com/apache/hive/pull/6499#discussion_r3303226582
##########
standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/builder/HiveMetaStoreClientBuilder.java:
##########
@@ -81,16 +89,16 @@ public IMetaStoreClient build() {
}
private static IMetaStoreClient createClient(Configuration conf, boolean
allowEmbedded) throws MetaException {
- Class<? extends IMetaStoreClient> mscClass = MetastoreConf.getClass(
- conf, MetastoreConf.ConfVars.METASTORE_CLIENT_IMPL,
- ThriftHiveMetaStoreClient.class, IMetaStoreClient.class);
- LOG.info("Using {} as a base MetaStoreClient", mscClass.getName());
-
- IMetaStoreClient baseMetaStoreClient = null;
try {
- baseMetaStoreClient = JavaUtils.newInstance(mscClass,
- new Class[]{Configuration.class, boolean.class},
- new Object[]{conf, allowEmbedded});
+ Class<? extends IMetaStoreClient> mscClass = MetastoreConf.getClass(
+ conf, MetastoreConf.ConfVars.METASTORE_CLIENT_IMPL,
+ ThriftHiveMetaStoreClient.class, IMetaStoreClient.class);
+ LOG.info("Using {} as a base MetaStoreClient", mscClass.getName());
+ MetaStoreClientFactory factory = CLIENT_FACTORIES.get(mscClass);
+ if (factory == null) {
+ CLIENT_FACTORIES.put(mscClass, factory = new
MetaStoreClientFactory(mscClass));
Review Comment:
why do you initiate CLIENT_FACTORIES inside createClient ? that doesn't seem
a good design
--
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]