org.apache.hadoop.hive.ql.exec.tez
Class TezSessionState

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.tez.TezSessionState

public class TezSessionState
extends Object

Holds session state related to Tez


Constructor Summary
TezSessionState(DagUtils utils)
          Constructor.
TezSessionState(String sessionId)
          Constructor.
 
Method Summary
 void cleanupScratchDir()
           
 void close(boolean keepTmpDir)
          Close a tez session.
 org.apache.hadoop.yarn.api.records.LocalResource getAppJarLr()
           
 HiveConf getConf()
           
 List<org.apache.hadoop.yarn.api.records.LocalResource> getLocalizedResources()
           
static List<TezSessionState> getOpenSessions()
          Get all open sessions.
 String getQueueName()
           
 org.apache.tez.client.TezSession getSession()
           
 String getSessionId()
           
 org.apache.hadoop.fs.Path getTezScratchDir()
           
 String getUser()
           
 boolean hasResources(String[] localAmResources)
           
 boolean isDefault()
           
 boolean isOpen()
          Returns whether a session has been established
 List<org.apache.hadoop.yarn.api.records.LocalResource> localizeAdditionalFiles(String[] additionalFiles)
           
static String makeSessionId()
           
 void open(HiveConf conf)
           
 void open(HiveConf conf, String[] additionalFiles)
          Creates a tez session.
 void setDefault()
           
 void setQueueName(String queueName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TezSessionState

public TezSessionState(DagUtils utils)
Constructor. We do not automatically connect, because we only want to load tez classes when the user has tez installed.


TezSessionState

public TezSessionState(String sessionId)
Constructor. We do not automatically connect, because we only want to load tez classes when the user has tez installed.

Method Detail

isOpen

public boolean isOpen()
Returns whether a session has been established


getOpenSessions

public static List<TezSessionState> getOpenSessions()
Get all open sessions. Only used to clean up at shutdown.

Returns:
List

makeSessionId

public static String makeSessionId()

open

public void open(HiveConf conf)
          throws IOException,
                 LoginException,
                 URISyntaxException,
                 org.apache.tez.dag.api.TezException
Throws:
IOException
LoginException
URISyntaxException
org.apache.tez.dag.api.TezException

open

public void open(HiveConf conf,
                 String[] additionalFiles)
          throws IOException,
                 LoginException,
                 IllegalArgumentException,
                 URISyntaxException,
                 org.apache.tez.dag.api.TezException
Creates a tez session. A session is tied to either a cli/hs2 session. You can submit multiple DAGs against a session (as long as they are executed serially).

Throws:
IOException
URISyntaxException
LoginException
org.apache.tez.dag.api.TezException
IllegalArgumentException

localizeAdditionalFiles

public List<org.apache.hadoop.yarn.api.records.LocalResource> localizeAdditionalFiles(String[] additionalFiles)
                                                                               throws IOException,
                                                                                      LoginException
Throws:
IOException
LoginException

hasResources

public boolean hasResources(String[] localAmResources)

close

public void close(boolean keepTmpDir)
           throws org.apache.tez.dag.api.TezException,
                  IOException
Close a tez session. Will cleanup any tez/am related resources. After closing a session no further DAGs can be executed against it.

Parameters:
keepTmpDir - whether or not to remove the scratch dir at the same time.
Throws:
IOException
org.apache.tez.dag.api.TezException

cleanupScratchDir

public void cleanupScratchDir()
                       throws IOException
Throws:
IOException

getSessionId

public String getSessionId()

getSession

public org.apache.tez.client.TezSession getSession()

getTezScratchDir

public org.apache.hadoop.fs.Path getTezScratchDir()

getAppJarLr

public org.apache.hadoop.yarn.api.records.LocalResource getAppJarLr()

setQueueName

public void setQueueName(String queueName)

getQueueName

public String getQueueName()

setDefault

public void setDefault()

isDefault

public boolean isDefault()

getConf

public HiveConf getConf()

getLocalizedResources

public List<org.apache.hadoop.yarn.api.records.LocalResource> getLocalizedResources()

getUser

public String getUser()


Copyright © 2014 The Apache Software Foundation. All rights reserved.