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 HiveSessionHiveSQLExceptionpublic void setOperationLogSessionDir(File operationLogRootDir)
HiveSessionBasesetOperationLogSessionDir in interface HiveSessionBaseoperationLogRootDir - the parent dir of the session dirpublic boolean isOperationLogEnabled()
HiveSessionBaseisOperationLogEnabled in interface HiveSessionBasepublic File getOperationLogSessionDir()
HiveSessionBasegetOperationLogSessionDir in interface HiveSessionBasepublic TProtocolVersion getProtocolVersion()
getProtocolVersion in interface HiveSessionBasepublic SessionManager getSessionManager()
HiveSessionBasegetSessionManager in interface HiveSessionBasepublic void setSessionManager(SessionManager sessionManager)
HiveSessionBasesetSessionManager in interface HiveSessionBasepublic void setOperationManager(OperationManager operationManager)
HiveSessionBasesetOperationManager in interface HiveSessionBaseprotected void acquire(boolean userAccess)
protected void release(boolean userAccess)
ThreadWithGarbageCleanup.finalize()public SessionHandle getSessionHandle()
getSessionHandle in interface HiveSessionBasepublic String getUsername()
getUsername in interface HiveSessionBasepublic String getPassword()
getPassword in interface HiveSessionBasepublic HiveConf getHiveConf()
getHiveConf in interface HiveSessionBasepublic IMetaStoreClient getMetaStoreClient() throws HiveSQLException
getMetaStoreClient in interface HiveSessionHiveSQLExceptionpublic GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException
HiveSessiongetInfo in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatement(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSessionexecuteStatement in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatementAsync(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSessionexecuteStatementAsync in interface HiveSessionHiveSQLExceptionpublic OperationHandle getTypeInfo() throws HiveSQLException
HiveSessiongetTypeInfo in interface HiveSessionHiveSQLExceptionpublic OperationHandle getCatalogs() throws HiveSQLException
HiveSessiongetCatalogs in interface HiveSessionHiveSQLExceptionpublic OperationHandle getSchemas(String catalogName, String schemaName) throws HiveSQLException
HiveSessiongetSchemas in interface HiveSessionHiveSQLExceptionpublic OperationHandle getTables(String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException
HiveSessiongetTables in interface HiveSessionHiveSQLExceptionpublic OperationHandle getTableTypes() throws HiveSQLException
HiveSessiongetTableTypes in interface HiveSessionHiveSQLExceptionpublic OperationHandle getColumns(String catalogName, String schemaName, String tableName, String columnName) throws HiveSQLException
HiveSessiongetColumns in interface HiveSessionHiveSQLExceptionpublic OperationHandle getFunctions(String catalogName, String schemaName, String functionName) throws HiveSQLException
HiveSessiongetFunctions in interface HiveSessionHiveSQLExceptionpublic void close()
throws HiveSQLException
HiveSessionclose in interface HiveSessionHiveSQLExceptionpublic SessionState getSessionState()
getSessionState in interface HiveSessionBasepublic String getUserName()
getUserName in interface HiveSessionBasepublic void setUserName(String userName)
setUserName in interface HiveSessionBasepublic long getLastAccessTime()
getLastAccessTime in interface HiveSessionBasepublic void closeExpiredOperations()
closeExpiredOperations in interface HiveSessionpublic long getNoOperationTime()
getNoOperationTime in interface HiveSessionpublic void cancelOperation(OperationHandle opHandle) throws HiveSQLException
cancelOperation in interface HiveSessionHiveSQLExceptionpublic void closeOperation(OperationHandle opHandle) throws HiveSQLException
closeOperation in interface HiveSessionHiveSQLExceptionpublic TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException
getResultSetMetadata in interface HiveSessionHiveSQLExceptionpublic RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, FetchType fetchType) throws HiveSQLException
fetchResults in interface HiveSessionHiveSQLExceptionprotected HiveSession getSession()
public String getIpAddress()
getIpAddress in interface HiveSessionBasepublic void setIpAddress(String ipAddress)
setIpAddress in interface HiveSessionBasepublic String getDelegationToken(HiveAuthFactory authFactory, String owner, String renewer) throws HiveSQLException
getDelegationToken in interface HiveSessionHiveSQLExceptionpublic void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException
cancelDelegationToken in interface HiveSessionHiveSQLExceptionpublic void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException
renewDelegationToken in interface HiveSessionHiveSQLExceptionCopyright © 2017 The Apache Software Foundation. All rights reserved.