org.apache.hadoop.hive.cli
Class CliSessionState

java.lang.Object
  extended by org.apache.hadoop.hive.ql.session.SessionState
      extended by org.apache.hadoop.hive.cli.CliSessionState

public class CliSessionState
extends SessionState

CliSessionState.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.session.SessionState
SessionState.LogHelper, SessionState.ResourceHook, SessionState.ResourceType
 
Field Summary
 Properties cmdProperties
          properties set from -hiveconf via cmdline.
 String database
          -database option if any that the session has been invoked with.
 String execString
          -e option if any that the session has been invoked with.
 String fileName
          -f option if any that the session has been invoked with.
protected  String host
          host name and port number of remote Hive server
 List<String> initFiles
          -i option if any that the session has been invoked with.
protected  int port
           
 
Fields inherited from class org.apache.hadoop.hive.ql.session.SessionState
childErr, childOut, conf, err, hiveHist, in, info, isSilent, isVerbose, out, tmpOutputFile
 
Constructor Summary
CliSessionState()
           
CliSessionState(HiveConf conf)
           
 
Method Summary
 void close()
           
 void connect()
          Connect to Hive Server
 HiveClient getClient()
           
 String getCurrentDbName()
          Return the name of the current database
 String getHost()
           
 int getPort()
           
 boolean isRemoteMode()
           
 void setHost(String host)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.session.SessionState
add_builtin_resource, add_resource, add_resource, addLocalMapRedErrors, canDownloadResource, delete_resource, delete_resource, find_resource_type, get, getAuthenticator, getAuthorizer, getCmd, getCommandType, getConf, getConsole, getCreateTableGrants, getHiveHistory, getHiveOperation, getHiveVariables, getIsSilent, getIsVerbose, getLastMapRedStatsList, getLineageState, getLocalMapRedErrors, getOverriddenConfigurations, getQueryId, getSessionId, getStackTraces, getTmpOutputFile, list_resource, registerJar, setAuthenticator, setAuthorizer, setCmd, setCommandType, setConf, setCreateTableGrants, setHiveVariables, setIsSilent, setIsVerbose, setLastMapRedStatsList, setLocalMapRedErrors, setOverriddenConfigurations, setStackTraces, setTmpOutputFile, start, start, unregisterJar, validateFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

database

public String database
-database option if any that the session has been invoked with.


execString

public String execString
-e option if any that the session has been invoked with.


fileName

public String fileName
-f option if any that the session has been invoked with.


cmdProperties

public Properties cmdProperties
properties set from -hiveconf via cmdline.


initFiles

public List<String> initFiles
-i option if any that the session has been invoked with.


host

protected String host
host name and port number of remote Hive server


port

protected int port
Constructor Detail

CliSessionState

public CliSessionState()

CliSessionState

public CliSessionState(HiveConf conf)
Method Detail

connect

public void connect()
             throws org.apache.thrift.transport.TTransportException
Connect to Hive Server

Throws:
org.apache.thrift.transport.TTransportException

setHost

public void setHost(String host)

getHost

public String getHost()

getPort

public int getPort()

close

public void close()

isRemoteMode

public boolean isRemoteMode()

getClient

public HiveClient getClient()

getCurrentDbName

public String getCurrentDbName()
Return the name of the current database

Returns:
the name of the current database or, if an error, null


Copyright © 2013 The Apache Software Foundation