public class HiveSessionImpl extends Object implements HiveSession
| Constructor and Description |
|---|
HiveSessionImpl(SessionHandle sessionHandle,
org.apache.hive.service.rpc.thrift.TProtocolVersion protocol,
String username,
String password,
HiveConf serverConf,
String ipAddress,
List<String> forwardedAddresses) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
acquire(boolean userAccess,
boolean isOperation) |
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 |
executeStatement(String statement,
Map<String,String> confOverlay,
long queryTimeout)
execute operation handler
|
OperationHandle |
executeStatementAsync(String statement,
Map<String,String> confOverlay)
execute operation handler
|
OperationHandle |
executeStatementAsync(String statement,
Map<String,String> confOverlay,
long queryTimeout)
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
|
long |
getCreationTime() |
OperationHandle |
getCrossReference(String primaryCatalog,
String primarySchema,
String primaryTable,
String foreignCatalog,
String foreignSchema,
String foreignTable)
getCrossReference operation handler
|
String |
getDelegationToken(HiveAuthFactory authFactory,
String owner,
String renewer) |
List<String> |
getForwardedAddresses() |
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() |
int |
getOpenOperationCount() |
File |
getOperationLogSessionDir()
Get the session dir, which is the parent dir of operation logs
|
String |
getPassword() |
OperationHandle |
getPrimaryKeys(String catalog,
String schema,
String table)
getPrimaryKeys operation handler
|
org.apache.hive.service.rpc.thrift.TProtocolVersion |
getProtocolVersion() |
TableSchema |
getResultSetMetadata(OperationHandle opHandle) |
OperationHandle |
getSchemas(String catalogName,
String schemaName)
getSchemas operation handler
|
protected HiveSession |
getSession() |
HiveConf |
getSessionConf() |
SessionHandle |
getSessionHandle() |
Hive |
getSessionHive() |
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() |
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,
boolean isOperation)
1.
|
void |
renewDelegationToken(HiveAuthFactory authFactory,
String tokenStr) |
void |
setApplicationName(String value) |
void |
setForwardedAddresses(List<String> forwardedAddresses) |
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) |
Future<?> |
submitBackgroundOperation(Runnable work) |
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 org.apache.hive.service.rpc.thrift.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,
boolean isOperation)
protected void release(boolean userAccess,
boolean isOperation)
ThreadWithGarbageCleanup.finalize()public SessionHandle getSessionHandle()
getSessionHandle in interface HiveSessionBasepublic String getPassword()
getPassword in interface HiveSessionBasepublic HiveConf getHiveConf()
getHiveConf in interface HiveSessionBasepublic Hive getSessionHive()
getSessionHive in interface HiveSessionpublic IMetaStoreClient getMetaStoreClient() throws HiveSQLException
getMetaStoreClient in interface HiveSessionHiveSQLExceptionpublic GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException
HiveSessiongetInfo in interface HiveSessionHiveSQLExceptionpublic HiveConf getSessionConf() throws HiveSQLException
getSessionConf in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatement(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSessionexecuteStatement in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatement(String statement, Map<String,String> confOverlay, long queryTimeout) throws HiveSQLException
HiveSessionexecuteStatement in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatementAsync(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSessionexecuteStatementAsync in interface HiveSessionHiveSQLExceptionpublic OperationHandle executeStatementAsync(String statement, Map<String,String> confOverlay, long queryTimeout) throws HiveSQLException
HiveSessionexecuteStatementAsync in interface HiveSessionHiveSQLExceptionpublic Future<?> submitBackgroundOperation(Runnable work)
submitBackgroundOperation in interface HiveSessionpublic 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 long getCreationTime()
getCreationTime 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 int getOpenOperationCount()
getOpenOperationCount in interface HiveSessionBasepublic String getIpAddress()
getIpAddress in interface HiveSessionBasepublic void setIpAddress(String ipAddress)
setIpAddress in interface HiveSessionBasepublic List<String> getForwardedAddresses()
getForwardedAddresses in interface HiveSessionBasepublic void setForwardedAddresses(List<String> forwardedAddresses)
setForwardedAddresses 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 HiveSessionHiveSQLExceptionpublic OperationHandle getPrimaryKeys(String catalog, String schema, String table) throws HiveSQLException
HiveSessiongetPrimaryKeys in interface HiveSessionHiveSQLExceptionpublic OperationHandle getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException
HiveSessiongetCrossReference in interface HiveSessionHiveSQLExceptionpublic void setApplicationName(String value)
setApplicationName in interface HiveSessionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.