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).
|
PrintStream |
err |
protected HiveHistory |
hiveHist |
InputStream |
in
Streams to read/write from.
|
PrintStream |
info |
protected boolean |
isSilent
silent mode.
|
protected boolean |
isVerbose
verbose mode
|
PrintStream |
out |
protected ClassLoader |
parentLoader |
protected File |
tmpErrOutputFile
Temporary file name used to store error output of executing non-Hive commands (e.g., set, dfs)
|
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 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
protected File tmpErrOutputFile
public SessionState(HiveConf conf)
public LineageState getLineageState()
public HiveConf getConf()
public File getTmpOutputFile()
public void setTmpOutputFile(File f)
public File getTmpErrOutputFile()
public void setTmpErrOutputFile(File tmpErrOutputFile)
public void deleteTmpOutputFile()
public void deleteTmpErrOutputFile()
public boolean getIsSilent()
public boolean isHiveServerQuery()
public void setIsSilent(boolean isSilent)
public ReentrantLock getCompileLock()
public boolean getIsVerbose()
public void setIsVerbose(boolean isVerbose)
public void setIsUsingThriftJDBCBinarySerDe(boolean isUsingThriftJDBCBinarySerDe)
public boolean getIsUsingThriftJDBCBinarySerDe()
public void setIsHiveServerQuery(boolean isHiveServerQuery)
public String getSessionId()
public void updateThreadName()
public void resetThreadName()
public HiveTxnManager initTxnMgr(HiveConf conf) throws LockException
conf
- Hive configuration to initialize transaction managerLockException
public HiveTxnManager getTxnMgr()
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 static void beginStart(SessionState startSs, SessionState.LogHelper console)
public static void endStart(SessionState startSs) throws CancellationException, InterruptedException
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 void updateHistory(boolean historyEnabled, SessionState ss)
historyEnabled
- ss
- 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
protected List<URI> resolveAndDownload(String value, boolean convertToUnix) throws URISyntaxException, IOException
URISyntaxException
IOException
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 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 void closeSparkSession()
public SessionState.AuthorizationMode getAuthorizationMode()
public boolean isAuthorizationModeV2()
public static PerfLogger getPerfLogger()
public static 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()
public ResourceDownloader getResourceDownloader()
Copyright © 2016 The Apache Software Foundation. All rights reserved.