public class HiveSessionImpl extends Object implements HiveSession
Constructor and Description |
---|
HiveSessionImpl(TProtocolVersion protocol,
String username,
String password,
HiveConf serverhiveConf,
String ipAddress) |
Modifier and Type | Method and Description |
---|---|
protected void |
acquire(boolean userAccess) |
void |
cancelDelegationToken(HiveAuthFactory authFactory,
String tokenStr) |
void |
cancelOperation(OperationHandle opHandle) |
void |
close()
close the session
|
void |
closeExpiredOperations() |
void |
closeOperation(OperationHandle opHandle) |
OperationHandle |
executeStatement(String statement,
Map<String,String> confOverlay)
execute operation handler
|
OperationHandle |
executeStatementAsync(String statement,
Map<String,String> confOverlay)
execute operation handler
|
RowSet |
fetchResults(OperationHandle opHandle,
FetchOrientation orientation,
long maxRows,
FetchType fetchType) |
OperationHandle |
getCatalogs()
getCatalogs operation handler
|
OperationHandle |
getColumns(String catalogName,
String schemaName,
String tableName,
String columnName)
getColumns operation handler
|
String |
getDelegationToken(HiveAuthFactory authFactory,
String owner,
String renewer) |
OperationHandle |
getFunctions(String catalogName,
String schemaName,
String functionName)
getFunctions operation handler
|
HiveConf |
getHiveConf() |
GetInfoValue |
getInfo(GetInfoType getInfoType)
getInfo operation handler
|
String |
getIpAddress() |
long |
getLastAccessTime() |
IMetaStoreClient |
getMetaStoreClient() |
long |
getNoOperationTime() |
File |
getOperationLogSessionDir()
Get the session dir, which is the parent dir of operation logs
|
String |
getPassword() |
TProtocolVersion |
getProtocolVersion() |
TableSchema |
getResultSetMetadata(OperationHandle opHandle) |
OperationHandle |
getSchemas(String catalogName,
String schemaName)
getSchemas operation handler
|
protected HiveSession |
getSession() |
SessionHandle |
getSessionHandle() |
SessionManager |
getSessionManager()
Get the session manager for the session
|
SessionState |
getSessionState() |
OperationHandle |
getTables(String catalogName,
String schemaName,
String tableName,
List<String> tableTypes)
getTables operation handler
|
OperationHandle |
getTableTypes()
getTableTypes operation handler
|
OperationHandle |
getTypeInfo()
getTypeInfo operation handler
|
String |
getUsername() |
String |
getUserName() |
boolean |
isOperationLogEnabled()
Check whether operation logging is enabled and session dir is created successfully
|
void |
open(Map<String,String> sessionConfMap) |
protected void |
release(boolean userAccess)
1.
|
void |
renewDelegationToken(HiveAuthFactory authFactory,
String tokenStr) |
void |
setIpAddress(String ipAddress) |
void |
setOperationLogSessionDir(File operationLogRootDir)
Set the session dir, which is the parent dir of operation logs
|
void |
setOperationManager(OperationManager operationManager)
Set operation manager for the session
|
void |
setSessionManager(SessionManager sessionManager)
Set the session manager for the session
|
void |
setUserName(String userName) |
public HiveSessionImpl(TProtocolVersion protocol, String username, String password, HiveConf serverhiveConf, String ipAddress)
public void open(Map<String,String> sessionConfMap) throws HiveSQLException
open
in interface HiveSession
HiveSQLException
public void setOperationLogSessionDir(File operationLogRootDir)
HiveSessionBase
setOperationLogSessionDir
in interface HiveSessionBase
operationLogRootDir
- the parent dir of the session dirpublic boolean isOperationLogEnabled()
HiveSessionBase
isOperationLogEnabled
in interface HiveSessionBase
public File getOperationLogSessionDir()
HiveSessionBase
getOperationLogSessionDir
in interface HiveSessionBase
public TProtocolVersion getProtocolVersion()
getProtocolVersion
in interface HiveSessionBase
public SessionManager getSessionManager()
HiveSessionBase
getSessionManager
in interface HiveSessionBase
public void setSessionManager(SessionManager sessionManager)
HiveSessionBase
setSessionManager
in interface HiveSessionBase
public void setOperationManager(OperationManager operationManager)
HiveSessionBase
setOperationManager
in interface HiveSessionBase
protected void acquire(boolean userAccess)
protected void release(boolean userAccess)
ThreadWithGarbageCleanup.finalize()
public SessionHandle getSessionHandle()
getSessionHandle
in interface HiveSessionBase
public String getUsername()
getUsername
in interface HiveSessionBase
public String getPassword()
getPassword
in interface HiveSessionBase
public HiveConf getHiveConf()
getHiveConf
in interface HiveSessionBase
public IMetaStoreClient getMetaStoreClient() throws HiveSQLException
getMetaStoreClient
in interface HiveSession
HiveSQLException
public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException
HiveSession
getInfo
in interface HiveSession
HiveSQLException
public OperationHandle executeStatement(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSession
executeStatement
in interface HiveSession
HiveSQLException
public OperationHandle executeStatementAsync(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSession
executeStatementAsync
in interface HiveSession
HiveSQLException
public OperationHandle getTypeInfo() throws HiveSQLException
HiveSession
getTypeInfo
in interface HiveSession
HiveSQLException
public OperationHandle getCatalogs() throws HiveSQLException
HiveSession
getCatalogs
in interface HiveSession
HiveSQLException
public OperationHandle getSchemas(String catalogName, String schemaName) throws HiveSQLException
HiveSession
getSchemas
in interface HiveSession
HiveSQLException
public OperationHandle getTables(String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException
HiveSession
getTables
in interface HiveSession
HiveSQLException
public OperationHandle getTableTypes() throws HiveSQLException
HiveSession
getTableTypes
in interface HiveSession
HiveSQLException
public OperationHandle getColumns(String catalogName, String schemaName, String tableName, String columnName) throws HiveSQLException
HiveSession
getColumns
in interface HiveSession
HiveSQLException
public OperationHandle getFunctions(String catalogName, String schemaName, String functionName) throws HiveSQLException
HiveSession
getFunctions
in interface HiveSession
HiveSQLException
public void close() throws HiveSQLException
HiveSession
close
in interface HiveSession
HiveSQLException
public SessionState getSessionState()
getSessionState
in interface HiveSessionBase
public String getUserName()
getUserName
in interface HiveSessionBase
public void setUserName(String userName)
setUserName
in interface HiveSessionBase
public long getLastAccessTime()
getLastAccessTime
in interface HiveSessionBase
public void closeExpiredOperations()
closeExpiredOperations
in interface HiveSession
public long getNoOperationTime()
getNoOperationTime
in interface HiveSession
public void cancelOperation(OperationHandle opHandle) throws HiveSQLException
cancelOperation
in interface HiveSession
HiveSQLException
public void closeOperation(OperationHandle opHandle) throws HiveSQLException
closeOperation
in interface HiveSession
HiveSQLException
public TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException
getResultSetMetadata
in interface HiveSession
HiveSQLException
public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, FetchType fetchType) throws HiveSQLException
fetchResults
in interface HiveSession
HiveSQLException
protected HiveSession getSession()
public String getIpAddress()
getIpAddress
in interface HiveSessionBase
public void setIpAddress(String ipAddress)
setIpAddress
in interface HiveSessionBase
public String getDelegationToken(HiveAuthFactory authFactory, String owner, String renewer) throws HiveSQLException
getDelegationToken
in interface HiveSession
HiveSQLException
public void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException
cancelDelegationToken
in interface HiveSession
HiveSQLException
public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException
renewDelegationToken
in interface HiveSession
HiveSQLException
Copyright © 2017 The Apache Software Foundation. All rights reserved.