This project has retired. For details please refer to its Attic page.
LensSessionImpl (Lens 2.1.0-beta-incubating API)

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.
 void close()
           
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> getDBResources(String database)
          Return resources which are added statically to the database
static Map<String,String> getHiveSessionConf()
           
 long getLastAccessTime()
           
 LensSessionImpl.LensSessionPersistInfo getLensSessionPersistInfo()
           
 String getLoggedInUser()
           
 Collection<LensSessionImpl.ResourceEntry> getPendingSessionResourcesForDatabase(String database)
          Get session's resources which have to be added for the given database
 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, 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()

close

public void close()
           throws org.apache.hive.service.cli.HiveSQLException
Specified by:
close in interface org.apache.hive.service.cli.session.HiveSession
Overrides:
close in class org.apache.hive.service.cli.session.HiveSessionImpl
Throws:
org.apache.hive.service.cli.HiveSQLException

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()

getDBResources

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

Returns:

getPendingSessionResourcesForDatabase

public Collection<LensSessionImpl.ResourceEntry> getPendingSessionResourcesForDatabase(String database)
Get session's resources which have to be added for the given database


getClassLoader

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

Returns:


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