org.apache.lens.server.session
Class HiveSessionService

java.lang.Object
  extended by org.apache.hive.service.AbstractService
      extended by org.apache.hive.service.CompositeService
          extended by org.apache.lens.server.LensService
              extended by org.apache.lens.server.session.HiveSessionService
All Implemented Interfaces:
Externalizable, Serializable, org.apache.hive.service.Service, SessionService

public class HiveSessionService
extends LensService
implements SessionService

The Class HiveSessionService.

See Also:
Serialized Form

Nested Class Summary
 class HiveSessionService.SessionExpiryRunnable
          The Class SessionExpiryRunnable.
 
Nested classes/interfaces inherited from class org.apache.hive.service.CompositeService
org.apache.hive.service.CompositeService.CompositeServiceShutdownHook
 
Nested classes/interfaces inherited from interface org.apache.hive.service.Service
org.apache.hive.service.Service.STATE
 
Field Summary
static org.apache.commons.logging.Log LOG
          The Constant LOG.
 
Fields inherited from interface org.apache.lens.server.api.session.SessionService
NAME
 
Constructor Summary
HiveSessionService(org.apache.hive.service.cli.CLIService cliService)
          Instantiates a new hive session service.
 
Method Summary
 void addResource(LensSessionHandle sessionid, String type, String path)
          Adds the resource.
 int addResourceToAllServices(LensSessionHandle sessionid, String type, String path)
          Adds the resource to all services.
 void closeSession(LensSessionHandle sessionHandle)
          Close session.
 void deleteResource(LensSessionHandle sessionid, String type, String path)
          Delete resource.
 List<String> getAllSessionParameters(LensSessionHandle sessionid, boolean verbose, String key)
          Gets the all session parameters.
 void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
           
 List<String> listAllResources(LensSessionHandle sessionHandle, String type)
          Lists resources from the session service
 LensSessionHandle openSession(String username, String password, String database, Map<String,String> configuration)
          Open session.
 void readExternal(ObjectInput in)
           
 void setSessionParameter(LensSessionHandle sessionid, String key, String value)
          Sets the session parameter.
 void start()
           
 void stop()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.apache.lens.server.LensService
acquire, acquire, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getServerDomain, getSession, getSessionManager, openSession, prepareStopping, release, release, restoreSession
 
Methods inherited from class org.apache.hive.service.CompositeService
getServices
 
Methods inherited from class org.apache.hive.service.AbstractService
getHiveConf, getName, getServiceState, getStartTime, register, unregister
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.lens.server.api.session.SessionService
restoreSession
 

Field Detail

LOG

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

Constructor Detail

HiveSessionService

public HiveSessionService(org.apache.hive.service.cli.CLIService cliService)
Instantiates a new hive session service.

Parameters:
cliService - the cli service
Method Detail

addResourceToAllServices

public int addResourceToAllServices(LensSessionHandle sessionid,
                                    String type,
                                    String path)
Description copied from interface: SessionService
Adds the resource to all services.

Specified by:
addResourceToAllServices in interface SessionService
Parameters:
sessionid - the sessionid
type - the type
path - the path
Returns:
the number of services that the resource has been added to

listAllResources

public List<String> listAllResources(LensSessionHandle sessionHandle,
                                     String type)
Description copied from interface: SessionService
Lists resources from the session service

Specified by:
listAllResources in interface SessionService
Parameters:
sessionHandle - the sessionid
type - the resource type, can be null, file or jar
Returns:
Lists resources for a given resource type. Lists all resources if resource type is null

addResource

public void addResource(LensSessionHandle sessionid,
                        String type,
                        String path)
Description copied from class: LensService
Adds the resource.

Specified by:
addResource in interface SessionService
Overrides:
addResource in class LensService
Parameters:
sessionid - the session handle
type - the type
path - the path

deleteResource

public void deleteResource(LensSessionHandle sessionid,
                           String type,
                           String path)
Description copied from class: LensService
Delete resource.

Specified by:
deleteResource in interface SessionService
Overrides:
deleteResource in class LensService
Parameters:
sessionid - the session handle
type - the type
path - the path

openSession

public LensSessionHandle openSession(String username,
                                     String password,
                                     String database,
                                     Map<String,String> configuration)
                              throws LensException
Description copied from interface: SessionService
Open session.

Specified by:
openSession in interface SessionService
Parameters:
username - the username
password - the password
database - Set current database to the supplied value
configuration - the configuration
Returns:
the lens session handle
Throws:
LensException - the lens exception

getAllSessionParameters

public List<String> getAllSessionParameters(LensSessionHandle sessionid,
                                            boolean verbose,
                                            String key)
                                     throws LensException
Description copied from interface: SessionService
Gets the all session parameters.

Specified by:
getAllSessionParameters in interface SessionService
Parameters:
sessionid - the sessionid
verbose - the verbose
key - the key
Returns:
the all session parameters
Throws:
LensException - the lens exception

setSessionParameter

public void setSessionParameter(LensSessionHandle sessionid,
                                String key,
                                String value)
Description copied from interface: SessionService
Sets the session parameter.

Specified by:
setSessionParameter in interface SessionService
Parameters:
sessionid - the sessionid
key - the key
value - the value

init

public void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
Specified by:
init in interface org.apache.hive.service.Service
Overrides:
init in class org.apache.hive.service.CompositeService

start

public void start()
Specified by:
start in interface org.apache.hive.service.Service
Overrides:
start in class org.apache.hive.service.CompositeService

stop

public void stop()
Specified by:
stop in interface org.apache.hive.service.Service
Overrides:
stop in class org.apache.hive.service.CompositeService

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class LensService
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class LensService
Throws:
IOException
ClassNotFoundException

closeSession

public void closeSession(LensSessionHandle sessionHandle)
                  throws LensException
Description copied from class: LensService
Close session.

Specified by:
closeSession in interface SessionService
Overrides:
closeSession in class LensService
Parameters:
sessionHandle - the session handle
Throws:
LensException - the lens exception


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