@InterfaceAudience.Public public class TezClient extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
TezClient.TezClientBuilder
A builder for setting up an instance of  
TezClient | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
TezClient(String name,
         TezConfiguration tezConf,
         boolean isSession,
         Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources,
         org.apache.hadoop.security.Credentials credentials)  | 
protected  | 
TezClient(String name,
         TezConfiguration tezConf,
         boolean isSession,
         Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources,
         org.apache.hadoop.security.Credentials credentials,
         ServicePluginsDescriptor servicePluginsDescriptor)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addAppMasterLocalFiles(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles)
Add local files for the DAG App Master. 
 | 
void | 
clearAppMasterLocalFiles()
If the next DAG App Master needs different local files, then use this
 method to clear the local files and then add the new local files
 using  
addAppMasterLocalFiles(Map). | 
static TezClient | 
create(String name,
      TezConfiguration tezConf)
Create a new TezClient. 
 | 
static TezClient | 
create(String name,
      TezConfiguration tezConf,
      boolean isSession)
Create a new TezClient with AM session mode set explicitly. 
 | 
static TezClient | 
create(String name,
      TezConfiguration tezConf,
      boolean isSession,
      Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles,
      org.apache.hadoop.security.Credentials credentials)
Create a new TezClient with AM session mode set explicitly. 
 | 
static TezClient | 
create(String name,
      TezConfiguration tezConf,
      Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles,
      org.apache.hadoop.security.Credentials credentials)
Create a new TezClient. 
 | 
protected FrameworkClient | 
createFrameworkClient()  | 
protected DAGClientAMProtocolBlockingPB | 
getAMProxy(org.apache.hadoop.yarn.api.records.ApplicationId appId)  | 
org.apache.hadoop.yarn.api.records.ApplicationId | 
getAppMasterApplicationId()  | 
TezAppMasterStatus | 
getAppMasterStatus()
Get the status of the App Master executing the DAG
 In non-session mode it returns the status of the last submitted DAG App Master 
 In session mode, it returns the status of the App Master hosting the session 
 | 
String | 
getClientName()
Get the name of the client 
 | 
static TezClient.TezClientBuilder | 
newBuilder(String name,
          TezConfiguration tezConf)
Create a new TezClientBuilder. 
 | 
void | 
preWarm(PreWarmVertex preWarmVertex)
API to help pre-allocate containers in session mode. 
 | 
void | 
setAppMasterCredentials(org.apache.hadoop.security.Credentials credentials)
Set security credentials to be used inside the app master, if needed. 
 | 
void | 
setUpHistoryAclManager(HistoryACLPolicyManager myAclPolicyManager)  | 
void | 
start()
Start the client. 
 | 
void | 
stop()
Stop the client. 
 | 
DAGClient | 
submitDAG(DAG dag)
Submit a DAG. 
 | 
void | 
waitTillReady()
Wait till the DAG is ready to be submitted. 
 | 
public static final String DAG
@InterfaceAudience.Private protected TezClient(String name, TezConfiguration tezConf, boolean isSession, @Nullable Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources, @Nullable org.apache.hadoop.security.Credentials credentials)
@InterfaceAudience.Private protected TezClient(String name, TezConfiguration tezConf, boolean isSession, @Nullable Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localResources, @Nullable org.apache.hadoop.security.Credentials credentials, ServicePluginsDescriptor servicePluginsDescriptor)
public static TezClient.TezClientBuilder newBuilder(String name, TezConfiguration tezConf)
name - Name of the client. Used for logging etc. This will also be used
                as app master name is session modetezConf - Configuration for the frameworkTezClient.TezClientBuilder
 which can be used to construct the final TezClient.public static TezClient create(String name, TezConfiguration tezConf)
name - Name of the client. Used for logging etc. This will also be used
          as app master name is session modetezConf - Configuration for the frameworkpublic static TezClient create(String name, TezConfiguration tezConf, @Nullable Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles, @Nullable org.apache.hadoop.security.Credentials credentials)
name - Name of the client. Used for logging etc. This will also be used
          as app master name is session modetezConf - Configuration for the frameworklocalFiles - local files for the App Mastercredentials - Set security credentials to be used inside the app master, if
          needed. Tez App Master needs credentials to access the staging
          directory and for most HDFS cases these are automatically obtained
          by Tez client. If the staging directory is on a file system for
          which credentials cannot be obtained or for any credentials needed
          by user code running inside the App Master, credentials must be
          supplied by the user. These will be used by the App Master for the
          next DAG. public static TezClient create(String name, TezConfiguration tezConf, boolean isSession)
name - Name of the client. Used for logging etc. This will also be used
          as app master name is session modetezConf - Configuration for the frameworkisSession - The AM will run in session mode or notpublic static TezClient create(String name, TezConfiguration tezConf, boolean isSession, @Nullable Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles, @Nullable org.apache.hadoop.security.Credentials credentials)
name - Name of the client. Used for logging etc. This will also be used
          as app master name is session modetezConf - Configuration for the frameworkisSession - The AM will run in session mode or notlocalFiles - local files for the App Mastercredentials - credentials for the App Masterpublic void addAppMasterLocalFiles(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> localFiles)
 In non-session mode these will be added to the files of the App Master
 to be launched for the next DAG. Files added via this method will
 accumulate and be used for every new App Master until
 clearAppMasterLocalFiles() is invoked. 
 
In session mode, the recommended usage is to add all files before calling start() so that all needed files are available to the app master before it starts. When called after start(), these local files will be re-localized to the running session DAG App Master and will be added to its classpath for execution of this DAG.
Caveats for invoking this method after start() in session mode: files accumulate across DAG submissions and are never removed from the classpath. Only LocalResourceType.FILE is supported. All files will be treated as private.
localFiles - the files to be made available in the AMpublic void clearAppMasterLocalFiles()
addAppMasterLocalFiles(Map). This method is a no-op in session mode,
 after start() is called.public void setAppMasterCredentials(org.apache.hadoop.security.Credentials credentials)
credentials - credentials@InterfaceAudience.Private public void setUpHistoryAclManager(HistoryACLPolicyManager myAclPolicyManager)
public void start()
           throws TezException,
                  IOException
TezExceptionIOExceptionpublic DAGClient submitDAG(DAG dag) throws TezException, IOException
dag - DAG to be submitted to SessionTezExceptionIOExceptionDAGSubmissionTimedOut - if submission timed outpublic void stop()
          throws TezException,
                 IOException
TezExceptionIOExceptionpublic String getClientName()
@InterfaceAudience.Private public org.apache.hadoop.yarn.api.records.ApplicationId getAppMasterApplicationId()
public TezAppMasterStatus getAppMasterStatus() throws TezException, IOException
TezExceptionIOException@InterfaceStability.Unstable public void preWarm(PreWarmVertex preWarmVertex) throws TezException, IOException
preWarmVertex - TezExceptionIOException@InterfaceStability.Evolving
public void waitTillReady()
                   throws IOException,
                          TezException,
                          InterruptedException
@InterfaceAudience.Private protected FrameworkClient createFrameworkClient()
protected DAGClientAMProtocolBlockingPB getAMProxy(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws TezException, IOException
TezExceptionIOExceptionCopyright © 2016 Apache Software Foundation. All rights reserved.