public class YarnUtil
extends java.lang.Object
| Constructor and Description |
|---|
YarnUtil(java.lang.String rmAddress,
int rmPort) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getApplicationState(java.lang.String applicationId)
This function returns the state of a given application.
|
java.lang.String |
getRunningAppId(java.lang.String jobName,
int jobID)
Queries rm for all the applications currently running and finds the application with the matching job name and id
|
void |
killApplication(java.lang.String applicationId)
This function kills an application given the applicationId
|
void |
stop()
This function stops the YarnUtil by stopping the yarn client and http client.
|
public java.lang.String getRunningAppId(java.lang.String jobName,
int jobID)
jobName - the name of the jobjobID - the job idpublic java.lang.String getApplicationState(java.lang.String applicationId)
throws java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
applicationId - the application id of the application the state is being queriedjava.io.IOException - Throws IO exceptionorg.apache.hadoop.yarn.exceptions.YarnException - in case of errors or if YARN rejects the request due to
access-control restrictions.public void killApplication(java.lang.String applicationId)
throws java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
applicationId - the application Id of the job to be killedjava.io.IOException - Throws IO exceptionorg.apache.hadoop.yarn.exceptions.YarnException - in case of errors or if YARN rejects the request due to
access-control restrictions.public void stop()