public class HiveSessionImpl extends Object implements HiveSession
Constructor and Description |
---|
HiveSessionImpl(SessionHandle sessionHandle,
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 |
downloadData(String tableName,
String query,
String format,
Map<String,String> options)
downloadData operation handler
|
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
|
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) |
void |
updateQueryTag(String queryId,
String queryTag) |
OperationHandle |
uploadData(ByteBuffer values,
String tableName,
String path)
uploadData operation handler
|
public HiveSessionImpl(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, HiveConf serverConf, String ipAddress, List<String> forwardedAddresses)
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, boolean isOperation)
protected void release(boolean userAccess, boolean isOperation)
ThreadWithGarbageCleanup.finalize()
public SessionHandle getSessionHandle()
getSessionHandle
in interface HiveSessionBase
public String getPassword()
getPassword
in interface HiveSessionBase
public HiveConf getHiveConf()
getHiveConf
in interface HiveSessionBase
public Hive getSessionHive()
getSessionHive
in interface HiveSession
public IMetaStoreClient getMetaStoreClient() throws HiveSQLException
getMetaStoreClient
in interface HiveSession
HiveSQLException
public GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException
HiveSession
getInfo
in interface HiveSession
HiveSQLException
public HiveConf getSessionConf() throws HiveSQLException
getSessionConf
in interface HiveSession
HiveSQLException
public OperationHandle executeStatement(String statement, Map<String,String> confOverlay) throws HiveSQLException
HiveSession
executeStatement
in interface HiveSession
HiveSQLException
public OperationHandle executeStatement(String statement, Map<String,String> confOverlay, long queryTimeout) 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 executeStatementAsync(String statement, Map<String,String> confOverlay, long queryTimeout) throws HiveSQLException
HiveSession
executeStatementAsync
in interface HiveSession
HiveSQLException
public Future<?> submitBackgroundOperation(Runnable work)
submitBackgroundOperation
in interface HiveSession
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 long getCreationTime()
getCreationTime
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 updateQueryTag(String queryId, String queryTag) throws HiveSQLException
updateQueryTag
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 int getOpenOperationCount()
getOpenOperationCount
in interface HiveSessionBase
public String getIpAddress()
getIpAddress
in interface HiveSessionBase
public void setIpAddress(String ipAddress)
setIpAddress
in interface HiveSessionBase
public List<String> getForwardedAddresses()
getForwardedAddresses
in interface HiveSessionBase
public void setForwardedAddresses(List<String> forwardedAddresses)
setForwardedAddresses
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
public OperationHandle getPrimaryKeys(String catalog, String schema, String table) throws HiveSQLException
HiveSession
getPrimaryKeys
in interface HiveSession
HiveSQLException
public OperationHandle getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException
HiveSession
getCrossReference
in interface HiveSession
HiveSQLException
public void setApplicationName(String value)
setApplicationName
in interface HiveSession
public OperationHandle uploadData(ByteBuffer values, String tableName, String path) throws HiveSQLException
HiveSession
uploadData
in interface HiveSession
HiveSQLException
public OperationHandle downloadData(String tableName, String query, String format, Map<String,String> options) throws HiveSQLException
HiveSession
downloadData
in interface HiveSession
HiveSQLException
Copyright © 2023 The Apache Software Foundation. All rights reserved.