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

Srikanth Srungarapu commented on HBASE-13358:
---------------------------------------------

Patch looks good to me. A few thoughts.
- Without patch, we're using connection with system user as default. But this 
changes is making use of {{SUPERUSER_CONN}} by default. [~anoop.hbase] Do you 
think this is acceptable? Or should we fall back to system user?
- How about staying away from using user object in action, as this makes 
extensibility untenable. In future, we might want to use same object with 
different users like we do with {{verifyAllowed}} in AC.
{code}
+    action1 = new PrivilegedExceptionAction<GetAuthsResponse>() {
+      public GetAuthsResponse run() throws Exception {
+        try {
+          return VisibilityClient.getAuths(NORMAL_USER1_CONN, "user1");
+        } catch (Throwable e) {
+        }
+        return null;
+      }
+    };
{code}
This should be like:
{code}
+    action1 = new PrivilegedExceptionAction<GetAuthsResponse>() {
+      public GetAuthsResponse run() throws Exception {
+        try (Connection conn = ConnectionFactory.createConnection(conf)) {
+          return VisibilityClient.getAuths(conn, "user1");
+        } 
+        return null;
+      }
+    };
{code}
But the nice thing with the approach in the patch is it reuses connections! 
Which tradeoff (extensibility vs perf) should we make? [~anoop.hbase] Again 
your inputs please :)



> Upgrade VisibilityClient API to accept Connection object.
> ---------------------------------------------------------
>
>                 Key: HBASE-13358
>                 URL: https://issues.apache.org/jira/browse/HBASE-13358
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Srikanth Srungarapu
>            Assignee: Matt Warhaftig
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: HBASE-13358.patch, HBASE-13358_v2.patch
>
>
> From VisibilityClient class:
> {code}
>   // TODO: Make it so caller passes in a Connection rather than have us do 
> this expensive
>     // setup each time.  This class only used in test and shell at moment 
> though.
> {code}
> Basically, this is the VC's counterpart of HBASE-13171. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to