org.apache.tez.client
Class TezSession

java.lang.Object
  extended by org.apache.tez.client.TezSession

public class TezSession
extends Object


Constructor Summary
TezSession(String sessionName, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, TezSessionConfiguration sessionConfig)
           
TezSession(String sessionName, TezSessionConfiguration sessionConfig)
           
 
Method Summary
 org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
           
 String getSessionName()
           
 TezSessionStatus getSessionStatus()
           
 void preWarm(PreWarmContext context)
          Inform the Session to pre-warm containers for upcoming DAGs.
 void start()
          Start a Tez Session
 void stop()
          Shutdown a Tez Session.
 DAGClient submitDAG(DAG dag)
          Submit a DAG to a Tez Session.
 DAGClient submitDAG(DAG dag, Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalAmResources)
          Submit a DAG to a Tez Session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TezSession

public TezSession(String sessionName,
                  org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
                  TezSessionConfiguration sessionConfig)

TezSession

public TezSession(String sessionName,
                  TezSessionConfiguration sessionConfig)
Method Detail

start

public void start()
           throws TezException,
                  IOException
Start a Tez Session

Throws:
TezException
IOException

submitDAG

public DAGClient submitDAG(DAG dag)
                    throws TezException,
                           IOException,
                           InterruptedException
Submit a DAG to a Tez Session. Blocks until either the DAG is submitted to the session or configured timeout period expires. Cleans up session if the submission timed out. Recommended API.

Parameters:
dag - DAG to be submitted to Session
Returns:
DAGClient to monitor the DAG
Throws:
TezException
IOException
SessionNotRunning - if session is not alive
DAGSubmissionTimedOut - if submission timed out
InterruptedException

submitDAG

public DAGClient submitDAG(DAG dag,
                           Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalAmResources)
                    throws TezException,
                           IOException,
                           InterruptedException
Submit a DAG to a Tez Session. Blocks until either the DAG is submitted to the session or configured timeout period expires. Cleans up session if the submission timed out. Allows specification of additional resources which will be added to the running AMs classpath for execution of this DAG.

Caveats: Resources stack across DAG submissions and are never removed from the classpath. Only LocalResourceType.FILE is supported. All resources will be treated as private. This method is not recommended unless their is no choice but to add resources to an existing session. Recommended usage is to setup AM local resources up front via AMConfiguration.

Parameters:
dag - DAG to be submitted to Session
additionalAmResources - additional resources which should be localized in the AM while executing this DAG.
Returns:
DAGClient to monitor the DAG
Throws:
TezException
IOException
SessionNotRunning - if session is not alive
DAGSubmissionTimedOut - if submission timed out
InterruptedException

stop

public void stop()
          throws TezException,
                 IOException
Shutdown a Tez Session.

Throws:
TezException
IOException

getSessionName

public String getSessionName()

getApplicationId

@InterfaceAudience.Private
public org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()

getSessionStatus

public TezSessionStatus getSessionStatus()
                                  throws TezException,
                                         IOException
Throws:
TezException
IOException

preWarm

@InterfaceAudience.Private
@InterfaceStability.Unstable
public void preWarm(PreWarmContext context)
             throws IOException,
                    TezException,
                    InterruptedException
Inform the Session to pre-warm containers for upcoming DAGs. Can be invoked multiple times on the same session. A subsequent call will release containers that are not compatible with the new context. This function can only be invoked if there is no DAG running on the Session This function can be a no-op if the Session already holds the required number of containers.

Parameters:
context - Context for the pre-warm containers.
Throws:
IOException
TezException
InterruptedException


Copyright © 2014 Apache Software Foundation. All rights reserved.