arina-ielchiieva commented on a change in pull request #1345: DRILL-6494: Drill
Plugins Handler
URL: https://github.com/apache/drill/pull/1345#discussion_r198842843
##########
File path:
contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java
##########
@@ -72,29 +71,27 @@ public HiveSchemaFactory(final HiveStoragePlugin plugin,
final String name, fina
isDrillImpersonationEnabled =
plugin.getContext().getConfig().getBoolean(ExecConstants.IMPERSONATION_ENABLED);
try {
+ // TODO: DRILL-6412. Clients for plugin should be instantiated only for
the case, when plugin is enabled
processUserMetastoreClient =
DrillHiveMetaStoreClient.createCloseableClientWithCaching(hiveConf);
- } catch (MetaException e) {
- throw new ExecutionSetupException("Failure setting up Hive metastore
client.", e);
- }
- metaStoreClientLoadingCache = CacheBuilder
- .newBuilder()
- .expireAfterAccess(10, TimeUnit.MINUTES)
- .maximumSize(5) // Up to 5 clients for impersonation-enabled.
- .removalListener(new RemovalListener<String,
DrillHiveMetaStoreClient>() {
- @Override
- public void onRemoval(RemovalNotification<String,
DrillHiveMetaStoreClient> notification) {
+ metaStoreClientLoadingCache = CacheBuilder
+ .newBuilder()
+ .expireAfterAccess(10, TimeUnit.MINUTES)
+ .maximumSize(5) // Up to 5 clients for impersonation-enabled.
+ .removalListener((RemovalListener<String, DrillHiveMetaStoreClient>)
notification -> {
DrillHiveMetaStoreClient client = notification.getValue();
client.close();
- }
- })
- .build(new CacheLoader<String, DrillHiveMetaStoreClient>() {
- @Override
- public DrillHiveMetaStoreClient load(String userName) throws
Exception {
- return
DrillHiveMetaStoreClient.createClientWithAuthz(processUserMetastoreClient,
hiveConf, userName);
- }
- });
+ })
+ .build(new CacheLoader<String, DrillHiveMetaStoreClient>() {
+ @Override
+ public DrillHiveMetaStoreClient load(String userName) throws
Exception {
+ return
DrillHiveMetaStoreClient.createClientWithAuthz(processUserMetastoreClient,
hiveConf, userName);
+ }
+ });
+ } catch (MetaException e) {
Review comment:
Why catch was moved?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services