org.apache.lens.server.session
Class LensSessionImpl

java.lang.Object
  extended by org.apache.hive.service.cli.session.HiveSessionImpl
      extended by org.apache.lens.server.session.LensSessionImpl
All Implemented Interfaces:
org.apache.hive.service.cli.session.HiveSession, org.apache.hive.service.cli.session.HiveSessionBase

public class LensSessionImpl
extends org.apache.hive.service.cli.session.HiveSessionImpl

The Class LensSessionImpl.


Nested Class Summary
static class LensSessionImpl.LensSessionPersistInfo
          The Class LensSessionPersistInfo.
static class LensSessionImpl.ResourceEntry
          The Class ResourceEntry.
 
Field Summary
static Map<String,String> DEFAULT_HIVE_SESSION_CONF
          The default hive session conf.
static org.apache.commons.logging.Log LOG
          The Constant LOG.
 
Fields inherited from interface org.apache.hive.service.cli.session.HiveSession
SESSION_CLOSED_MARKER
 
Constructor Summary
LensSessionImpl(org.apache.hive.service.cli.SessionHandle sessionHandle, org.apache.hive.service.cli.thrift.TProtocolVersion protocol, String username, String password, org.apache.hadoop.hive.conf.HiveConf serverConf, Map<String,String> sessionConf, String ipAddress)
          Constructor used when restoring session.
LensSessionImpl(org.apache.hive.service.cli.thrift.TProtocolVersion protocol, String username, String password, org.apache.hadoop.hive.conf.HiveConf serverConf, Map<String,String> sessionConf, String ipAddress)
          Instantiates a new lens session impl.
 
Method Summary
 void acquire()
           
 void addResource(String type, String path)
          Adds the resource.
static org.apache.hadoop.conf.Configuration createDefaultConf()
          Creates the default conf.
 ClassLoader getClassLoader()
          Get effective class loader for this session
 String getClusterUser()
           
 CubeMetastoreClient getCubeMetastoreClient()
           
 String getCurrentDatabase()
           
 Collection<LensSessionImpl.ResourceEntry> getCurrentDBResources()
          Return resources which are added statically to the current database
static Map<String,String> getHiveSessionConf()
           
 long getLastAccessTime()
           
 LensSessionImpl.LensSessionPersistInfo getLensSessionPersistInfo()
           
 String getLoggedInUser()
           
 org.apache.hadoop.conf.Configuration getSessionConf()
           
 boolean isActive()
           
 void release()
           
 void removeResource(String type, String path)
          Removes the resource.
 void setConfig(String key, String value)
          Sets the config.
 void setCurrentDatabase(String currentDatabase)
           
 String toString()
           
 
Methods inherited from class org.apache.hive.service.cli.session.HiveSessionImpl
cancelDelegationToken, cancelOperation, close, closeOperation, executeStatement, executeStatementAsync, fetchResults, fetchResults, getCatalogs, getColumns, getDelegationToken, getFunctions, getHiveConf, getInfo, getIpAddress, getMetaStoreClient, getPassword, getProtocolVersion, getQueryPlan, getResultSetMetadata, getSchemas, getSessionHandle, getSessionLogDir, getSessionManager, getSessionState, getTables, getTableTypes, getTypeInfo, getUsername, getUserName, isLogRedirectionEnabled, open, renewDelegationToken, setIpAddress, setOperationManager, setSessionManager, setupLogRedirection, setUserName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
The Constant LOG.


DEFAULT_HIVE_SESSION_CONF

public static final Map<String,String> DEFAULT_HIVE_SESSION_CONF
The default hive session conf.

Constructor Detail

LensSessionImpl

public LensSessionImpl(org.apache.hive.service.cli.thrift.TProtocolVersion protocol,
                       String username,
                       String password,
                       org.apache.hadoop.hive.conf.HiveConf serverConf,
                       Map<String,String> sessionConf,
                       String ipAddress)
Instantiates a new lens session impl.

Parameters:
protocol - the protocol
username - the username
password - the password
serverConf - the server conf
sessionConf - the session conf
ipAddress - the ip address

LensSessionImpl

public LensSessionImpl(org.apache.hive.service.cli.SessionHandle sessionHandle,
                       org.apache.hive.service.cli.thrift.TProtocolVersion protocol,
                       String username,
                       String password,
                       org.apache.hadoop.hive.conf.HiveConf serverConf,
                       Map<String,String> sessionConf,
                       String ipAddress)
Constructor used when restoring session.

Parameters:
sessionHandle - the session handle
protocol - the protocol
username - the username
password - the password
serverConf - the server conf
sessionConf - the session conf
ipAddress - the ip address
Method Detail

createDefaultConf

public static org.apache.hadoop.conf.Configuration createDefaultConf()
Creates the default conf.

Returns:
the configuration

getHiveSessionConf

public static Map<String,String> getHiveSessionConf()

getSessionConf

public org.apache.hadoop.conf.Configuration getSessionConf()

getCubeMetastoreClient

public CubeMetastoreClient getCubeMetastoreClient()
                                           throws LensException
Throws:
LensException

acquire

public void acquire()
Overrides:
acquire in class org.apache.hive.service.cli.session.HiveSessionImpl

release

public void release()
Overrides:
release in class org.apache.hive.service.cli.session.HiveSessionImpl

isActive

public boolean isActive()

setConfig

public void setConfig(String key,
                      String value)
Sets the config.

Parameters:
key - the key
value - the value

removeResource

public void removeResource(String type,
                           String path)
Removes the resource.

Parameters:
type - the type
path - the path

addResource

public void addResource(String type,
                        String path)
Adds the resource.

Parameters:
type - the type
path - the path

setCurrentDatabase

public void setCurrentDatabase(String currentDatabase)

getCurrentDatabase

public String getCurrentDatabase()

toString

public String toString()
Overrides:
toString in class Object

getLoggedInUser

public String getLoggedInUser()

getClusterUser

public String getClusterUser()

getLensSessionPersistInfo

public LensSessionImpl.LensSessionPersistInfo getLensSessionPersistInfo()

getLastAccessTime

public long getLastAccessTime()

getCurrentDBResources

public Collection<LensSessionImpl.ResourceEntry> getCurrentDBResources()
Return resources which are added statically to the current database

Returns:

getClassLoader

public ClassLoader getClassLoader()
Get effective class loader for this session

Returns:


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.