org.apache.hadoop.hbase.util
Class ConnectionCache

java.lang.Object
  extended by org.apache.hadoop.hbase.util.ConnectionCache

@InterfaceAudience.Private
public class ConnectionCache
extends Object

A utility to store user specific HConnections in memory. There is a chore to clean up connections idle for too long. This class is used by REST server and Thrift server to support authentication and impersonation.


Constructor Summary
ConnectionCache(org.apache.hadoop.conf.Configuration conf, UserProvider userProvider, int cleanInterval, int maxIdleTime)
           
 
Method Summary
 HBaseAdmin getAdmin()
          Caller doesn't close the admin afterwards.
 String getEffectiveUser()
          Get the current thread local effective user
 HTableInterface getTable(String tableName)
          Caller closes the table afterwards.
 void setEffectiveUser(String user)
          Set the current thread local effective user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionCache

public ConnectionCache(org.apache.hadoop.conf.Configuration conf,
                       UserProvider userProvider,
                       int cleanInterval,
                       int maxIdleTime)
                throws IOException
Throws:
IOException
Method Detail

setEffectiveUser

public void setEffectiveUser(String user)
Set the current thread local effective user


getEffectiveUser

public String getEffectiveUser()
Get the current thread local effective user


getAdmin

public HBaseAdmin getAdmin()
                    throws IOException
Caller doesn't close the admin afterwards. We need to manage it and close it properly.

Throws:
IOException

getTable

public HTableInterface getTable(String tableName)
                         throws IOException
Caller closes the table afterwards.

Throws:
IOException


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.