public abstract class BaseLensService extends org.apache.hive.service.CompositeService implements Externalizable, LensService
Modifier and Type | Method and Description |
---|---|
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() |
abstract HealthStatus |
getHealthStatus()
Returns the health status of the service.
|
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.
|
static int |
getNumberOfSessions() |
String |
getServerDomain() |
LensSessionImpl |
getSession(LensSessionHandle sessionHandle)
Gets the session.
|
org.apache.hive.service.cli.session.SessionManager |
getSessionManager() |
String |
getValidPath(File path,
boolean shouldBeDirectory,
boolean shouldExist)
Method that uses PathValidator to get appropriate path.
|
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.
|
String |
removePrefixBeforeURI(String path)
Method to remove unrequired prefix from path.
|
void |
restoreSession(LensSessionHandle sessionHandle,
String userName,
String password)
Restore session from previous instance of lens server.
|
void |
writeExternal(ObjectOutput out) |
getServices, init, start, stop
public org.apache.hive.service.cli.CLIService getCliService()
public String getServerDomain()
public static int getNumberOfSessions()
public LensSessionHandle openSession(String username, String password, Map<String,String> configuration) throws LensException
username
- the usernamepassword
- the passwordconfiguration
- the configurationLensException
- the lens exceptionpublic void restoreSession(LensSessionHandle sessionHandle, String userName, String password) throws LensException
sessionHandle
- the session handleuserName
- the user namepassword
- the passwordLensException
- the lens exceptionpublic void closeSession(LensSessionHandle sessionHandle) throws LensException
sessionHandle
- the session handleLensException
- the lens exceptionpublic org.apache.hive.service.cli.session.SessionManager getSessionManager()
public LensSessionImpl getSession(LensSessionHandle sessionHandle)
sessionHandle
- the session handlepublic void acquire(LensSessionHandle sessionHandle)
sessionHandle
- the session handlepublic void acquire(String sessionHandle)
sessionHandle
- public UUID of the sessionpublic void release(LensSessionHandle sessionHandle)
sessionHandle
- the session handlepublic void release(String sessionHandle) throws LensException
sessionHandle
- the session handleLensException
- if session cannot be releasedpublic void addResource(LensSessionHandle sessionHandle, String type, String path) throws LensException
sessionHandle
- the session handletype
- the typepath
- the pathLensException
- the lens exceptionpublic void deleteResource(LensSessionHandle sessionHandle, String type, String path) throws LensException
sessionHandle
- the session handletype
- the typepath
- the pathLensException
- the lens exceptionpublic static org.apache.hive.service.cli.SessionHandle getHiveSessionHandle(LensSessionHandle lensHandle)
lensHandle
- the lens handlepublic org.apache.hadoop.conf.Configuration getLensConf(LensSessionHandle sessionHandle, LensConf conf) throws LensException
sessionHandle
- the session handleconf
- the confLensException
- the lens exceptionpublic org.apache.hadoop.conf.Configuration getLensConf(LensConf conf) throws LensException
conf
- the confLensException
- the lens exceptionpublic void prepareStopping()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public abstract HealthStatus getHealthStatus()
getHealthStatus
in interface HealthCheckable
public String getValidPath(File path, boolean shouldBeDirectory, boolean shouldExist)
path
- shouldBeDirectory
- shouldExist
- Copyright © 2014–2016 Apache Software Foundation. All rights reserved.