[ 
https://issues.apache.org/jira/browse/DRILL-6494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16528426#comment-16528426
 ] 

ASF GitHub Bot commented on DRILL-6494:
---------------------------------------

vdiravka commented on a change in pull request #1345: DRILL-6494: Drill Plugins 
Handler
URL: https://github.com/apache/drill/pull/1345#discussion_r198886347
 
 

 ##########
 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:
   If the exception is obtained the further logic from constructor doesn't make 
sense.

----------------------------------------------------------------
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]


> Drill Plugins Handler
> ---------------------
>
>                 Key: DRILL-6494
>                 URL: https://issues.apache.org/jira/browse/DRILL-6494
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Tools, Build &amp; Test
>    Affects Versions: 1.13.0
>            Reporter: Vitalii Diravka
>            Assignee: Vitalii Diravka
>            Priority: Major
>              Labels: doc-impacting
>             Fix For: 1.14.0
>
>         Attachments: storage-plugins.conf
>
>
> The new service of updating Drill's plugins configs could be implemented.
> Please find details from design overview document:
> https://docs.google.com/document/d/14JKb2TA8dGnOIE5YT2RImkJ7R0IAYSGjJg8xItL5yMI/edit?usp=sharing



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to