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

Gary Helmling commented on HBASE-12493:
---------------------------------------

[~ychena] The Hive HBaseStorageHandler should create and manage the connection, 
doing something like:

{code}
Connection conn = ConnectionFactory.createConnection(job.getConfiguration());
try {
  UserProvider userProvider = UserProvider.instantiate(job.getConfiguration());
  TokenUtil.addTokenForJob(conn, userProvider.getCurrent(), job);
} finally {
  conn.close();
}
{code}

Creating the connection and managing it should really be done explicitly.  It's 
clunky and inefficient for us to do this hidden from the client code, which 
leads to nasty things like hidden connection caching that we've been trying to 
remove from the HBase code for a long time.  It's much simpler if we just make 
the connection handling explicit.  This is why I've deprecated all methods 
which do _not_ take a {{Connection}} instance, and have to create one behind 
the scenes.

Do you see any other issues?

> User class should provide a way to re-use existing token
> --------------------------------------------------------
>
>                 Key: HBASE-12493
>                 URL: https://issues.apache.org/jira/browse/HBASE-12493
>             Project: HBase
>          Issue Type: Task
>            Reporter: Brock Noland
>            Assignee: Gary Helmling
>             Fix For: 2.0.0
>
>         Attachments: HBASE-12493-v2.patch, HBASE-12493.patch
>
>
> In HIVE-8874 we had to re-use HBase classes market private to re-use using 
> tokens.



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

Reply via email to