org.apache.lens.server
Class LensService

java.lang.Object
  extended by org.apache.hive.service.AbstractService
      extended by org.apache.hive.service.CompositeService
          extended by org.apache.lens.server.LensService
All Implemented Interfaces:
Externalizable, Serializable, org.apache.hive.service.Service
Direct Known Subclasses:
CubeMetastoreServiceImpl, HiveSessionService, QueryExecutionServiceImpl, QuerySchedulerServiceImpl, QuotaServiceImpl

public abstract class LensService
extends org.apache.hive.service.CompositeService
implements Externalizable

The Class LensService.

See Also:
Serialized Form

Nested Class Summary
 
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.
 
Method Summary
 void acquire(LensSessionHandle sessionHandle)
          Acquire.
 void acquire(String sessionHandle)
          Acquire a lens session specified by the public UUID.
 void addResource(LensSessionHandle sessionHandle, String type, String path)
          Adds the resource.
 void closeSession(LensSessionHandle sessionHandle)
          Close session.
 void deleteResource(LensSessionHandle sessionHandle, String type, String path)
          Delete resource.
 org.apache.hive.service.cli.CLIService getCliService()
           
static org.apache.hive.service.cli.SessionHandle getHiveSessionHandle(LensSessionHandle lensHandle)
          Gets the hive session handle.
 org.apache.hadoop.conf.Configuration getLensConf(LensConf conf)
          Gets the lens conf.
 org.apache.hadoop.conf.Configuration getLensConf(LensSessionHandle sessionHandle, LensConf conf)
          Gets the lens conf.
 String getServerDomain()
           
 LensSessionImpl getSession(LensSessionHandle sessionHandle)
          Gets the session.
 org.apache.hive.service.cli.session.SessionManager getSessionManager()
           
 LensSessionHandle openSession(String username, String password, Map<String,String> configuration)
          Open session.
 void prepareStopping()
          Prepare stopping.
 void readExternal(ObjectInput in)
           
 void release(LensSessionHandle sessionHandle)
          Release.
 void release(String sessionHandle)
          Releases a lens session specified by the public UUID.
 void restoreSession(LensSessionHandle sessionHandle, String userName, String password)
          Restore session from previous instance of lens server.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.apache.hive.service.CompositeService
getServices, init, start, stop
 
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
 

Field Detail

LOG

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

Method Detail

getCliService

public org.apache.hive.service.cli.CLIService getCliService()
Returns:
the cliService

getServerDomain

public String getServerDomain()

openSession

public LensSessionHandle openSession(String username,
                                     String password,
                                     Map<String,String> configuration)
                              throws LensException
Open session.

Parameters:
username - the username
password - the password
configuration - the configuration
Returns:
the lens session handle
Throws:
LensException - the lens exception

restoreSession

public void restoreSession(LensSessionHandle sessionHandle,
                           String userName,
                           String password)
                    throws LensException
Restore session from previous instance of lens server.

Parameters:
sessionHandle - the session handle
userName - the user name
password - the password
Throws:
LensException - the lens exception

closeSession

public void closeSession(LensSessionHandle sessionHandle)
                  throws LensException
Close session.

Parameters:
sessionHandle - the session handle
Throws:
LensException - the lens exception

getSessionManager

public org.apache.hive.service.cli.session.SessionManager getSessionManager()

getSession

public LensSessionImpl getSession(LensSessionHandle sessionHandle)
Gets the session.

Parameters:
sessionHandle - the session handle
Returns:
the session

acquire

public void acquire(LensSessionHandle sessionHandle)
Acquire.

Parameters:
sessionHandle - the session handle

acquire

public void acquire(String sessionHandle)
Acquire a lens session specified by the public UUID.

Parameters:
sessionHandle - public UUID of the session

release

public void release(LensSessionHandle sessionHandle)
Release.

Parameters:
sessionHandle - the session handle

release

public void release(String sessionHandle)
             throws LensException
Releases a lens session specified by the public UUID.

Parameters:
sessionHandle - the session handle
Throws:
LensException - if session cannot be released

addResource

public void addResource(LensSessionHandle sessionHandle,
                        String type,
                        String path)
                 throws LensException
Adds the resource.

Parameters:
sessionHandle - the session handle
type - the type
path - the path
Throws:
LensException - the lens exception

deleteResource

public void deleteResource(LensSessionHandle sessionHandle,
                           String type,
                           String path)
                    throws LensException
Delete resource.

Parameters:
sessionHandle - the session handle
type - the type
path - the path
Throws:
LensException - the lens exception

getHiveSessionHandle

public static org.apache.hive.service.cli.SessionHandle getHiveSessionHandle(LensSessionHandle lensHandle)
Gets the hive session handle.

Parameters:
lensHandle - the lens handle
Returns:
the hive session handle

getLensConf

public org.apache.hadoop.conf.Configuration getLensConf(LensSessionHandle sessionHandle,
                                                        LensConf conf)
                                                 throws LensException
Gets the lens conf.

Parameters:
sessionHandle - the session handle
conf - the conf
Returns:
the lens conf
Throws:
LensException - the lens exception

getLensConf

public org.apache.hadoop.conf.Configuration getLensConf(LensConf conf)
                                                 throws LensException
Gets the lens conf.

Parameters:
conf - the conf
Returns:
the lens conf
Throws:
LensException - the lens exception

prepareStopping

public void prepareStopping()
Prepare stopping.


readExternal

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

writeExternal

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


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