public class SessionState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SessionState.AuthorizationMode |
static class |
SessionState.LogHelper
This class provides helper routines to emit informational and error
messages to the user and log4j files while obeying the current session's
verbosity levels.
|
static class |
SessionState.ResourceType
ResourceType.
|
Modifier and Type | Field and Description |
---|---|
PrintStream |
childErr
Error output from any child process(es).
|
PrintStream |
childOut
Standard output from any child process(es).
|
protected HiveConf |
conf
current configuration.
|
PrintStream |
err |
protected HiveHistory |
hiveHist |
InputStream |
in
Streams to read/write from.
|
PrintStream |
info |
protected boolean |
isSilent
silent mode.
|
protected boolean |
isVerbose
verbose mode
|
static long |
NO_CURRENT_TXN
When
setCurrentTxn(long) is set to this or getCurrentTxn() } returns this it
indicates that there is not a current transaction in this session. |
PrintStream |
out |
protected ClassLoader |
parentLoader |
protected File |
tmpOutputFile
Temporary file name used to store results of non-Hive commands (e.g., set, dfs)
and HiveServer.fetch*() function will read results from this file
|
Constructor and Description |
---|
SessionState(HiveConf conf) |
SessionState(HiveConf conf,
String userName) |
protected ClassLoader parentLoader
protected HiveConf conf
protected boolean isSilent
protected boolean isVerbose
protected HiveHistory hiveHist
public InputStream in
public PrintStream out
public PrintStream info
public PrintStream err
public PrintStream childOut
public PrintStream childErr
protected File tmpOutputFile
public static final long NO_CURRENT_TXN
setCurrentTxn(long)
is set to this or getCurrentTxn()
} returns this it
indicates that there is not a current transaction in this session.public SessionState(HiveConf conf)
public LineageState getLineageState()
public HiveConf getConf()
public void setConf(HiveConf conf)
public File getTmpOutputFile()
public void setTmpOutputFile(File f)
public boolean getIsSilent()
public boolean isHiveServerQuery()
public void setIsSilent(boolean isSilent)
public boolean getIsVerbose()
public void setIsVerbose(boolean isVerbose)
public void setIsHiveServerQuery(boolean isHiveServerQuery)
public void setCmd(String cmdString)
public String getCmd()
public String getQueryId()
public String getSessionId()
public HiveTxnManager initTxnMgr(HiveConf conf) throws LockException
conf
- Hive configuration to initialize transaction managerLockException
public HiveTxnManager getTxnMgr()
public long getCurrentTxn()
public void setCurrentTxn(long currTxn)
public boolean isAutoCommit()
public HadoopShims.HdfsEncryptionShim getHdfsEncryptionShim() throws HiveException
HiveException
public static SessionState start(HiveConf conf)
public static void setCurrentSessionState(SessionState startSs)
public static void detachSession()
public static SessionState start(SessionState startSs)
public String getHdfsScratchDirURIString()
public static org.apache.hadoop.fs.Path getLocalSessionPath(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.fs.Path getHDFSSessionPath(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.fs.Path getTempTableSpace(org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.fs.Path getTempTableSpace()
public Object getActiveAuthorizer()
public Class getAuthorizerInterface()
public void setActiveAuthorizer(Object authorizer)
public static SessionState get()
public static HiveConf getSessionConf()
public static Registry getRegistry()
public static Registry getRegistryForWrite()
public HiveHistory getHiveHistory()
public String getLastCommand()
public void setLastCommand(String lastCommand)
public static SessionState.LogHelper getConsole()
public static String getUserFromAuthenticator()
public void reloadAuxJars() throws IOException
IOException
public static SessionState.ResourceType find_resource_type(String s)
public String add_resource(SessionState.ResourceType t, String value) throws RuntimeException
RuntimeException
public String add_resource(SessionState.ResourceType t, String value, boolean convertToUnix) throws RuntimeException
RuntimeException
public List<String> add_resources(SessionState.ResourceType t, Collection<String> values) throws RuntimeException
RuntimeException
public List<String> add_resources(SessionState.ResourceType t, Collection<String> values, boolean convertToUnix) throws RuntimeException
RuntimeException
public static boolean canDownloadResource(String value)
public void delete_resources(SessionState.ResourceType t, List<String> values)
public Set<String> list_resource(SessionState.ResourceType t, List<String> filter)
public void delete_resources(SessionState.ResourceType t)
public String getCommandType()
public HiveOperation getHiveOperation()
public void setCommandType(HiveOperation commandType)
public HiveAuthorizationProvider getAuthorizer()
public void setAuthorizer(HiveAuthorizationProvider authorizer)
public HiveAuthorizer getAuthorizerV2()
public HiveAuthenticationProvider getAuthenticator()
public void setAuthenticator(HiveAuthenticationProvider authenticator)
public CreateTableAutomaticGrant getCreateTableGrants()
public void setCreateTableGrants(CreateTableAutomaticGrant createTableGrants)
public Map<String,MapRedStats> getMapRedStats()
public void setMapRedStats(Map<String,MapRedStats> mapRedStats)
public void setOverriddenConfigurations(Map<String,String> overriddenConfigurations)
public String getCurrentDatabase()
public void setCurrentDatabase(String currentDatabase)
public void close() throws IOException
IOException
public SessionState.AuthorizationMode getAuthorizationMode()
public boolean isAuthorizationModeV2()
public PerfLogger getPerfLogger(boolean resetPerfLogger)
resetPerfLogger
- public TezSessionState getTezSession()
public void setTezSession(TezSessionState session)
public String getUserName()
public void applyAuthorizationPolicy() throws HiveException
HiveException
public Map<String,Map<String,ColumnStatisticsObj>> getTempTableColStats()
public String getUserIpAddress()
public void setUserIpAddress(String userIpAddress)
userIpAddress
- public SparkSession getSparkSession()
public void setSparkSession(SparkSession sparkSession)
public String getNextValuesTempTableSuffix()
public void setupQueryCurrentTimestamp()
public Timestamp getQueryCurrentTimestamp()
Copyright © 2017 The Apache Software Foundation. All rights reserved.