org.apache.hadoop.yarn.client
Interface YarnClient

All Superinterfaces:
org.apache.hadoop.yarn.service.Service
All Known Implementing Classes:
Client, YarnClientImpl

@InterfaceAudience.Public
@InterfaceStability.Evolving
public interface YarnClient
extends org.apache.hadoop.yarn.service.Service


Method Summary
 List<QueueInfo> getAllQueues()
           Get information (QueueInfo) about all queues, recursively if there is a hierarchy
 List<ApplicationReport> getApplicationList()
           Get a report (ApplicationReport) of all Applications in the cluster.
 ApplicationReport getApplicationReport(ApplicationId appId)
           Get a report of the given Application.
 List<QueueInfo> getChildQueueInfos(String parent)
           Get information (QueueInfo) about all the immediate children queues of the given queue
 GetNewApplicationResponse getNewApplication()
           Obtain a new ApplicationId for submitting new applications.
 List<NodeReport> getNodeReports()
           Get a report of all nodes (NodeReport) in the cluster.
 List<QueueUserACLInfo> getQueueAclsInfo()
           Get information about acls for current user on all the existing queues.
 QueueInfo getQueueInfo(String queueName)
           Get information (QueueInfo) about a given queue.
 DelegationToken getRMDelegationToken(Text renewer)
           Get a delegation token so as to be able to talk to YARN using those tokens.
 List<QueueInfo> getRootQueueInfos()
           Get information (QueueInfo) about top level queues.
 YarnClusterMetrics getYarnClusterMetrics()
           Get metrics (YarnClusterMetrics) about the cluster.
 void killApplication(ApplicationId applicationId)
           Kill an application identified by given ID.
 ApplicationId submitApplication(ApplicationSubmissionContext appContext)
           Submit a new application to YARN.
 
Methods inherited from interface org.apache.hadoop.yarn.service.Service
getConfig, getName, getServiceState, getStartTime, init, register, start, stop, unregister
 

Method Detail

getNewApplication

GetNewApplicationResponse getNewApplication()
                                            throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Obtain a new ApplicationId for submitting new applications.

Returns a response which contains ApplicationId that can be used to submit a new application. See submitApplication(ApplicationSubmissionContext).

See GetNewApplicationResponse for other information that is returned.

Returns:
response containing the new ApplicationId to be used to submit an application
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

submitApplication

ApplicationId submitApplication(ApplicationSubmissionContext appContext)
                                throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Submit a new application to YARN.

Parameters:
appContext - ApplicationSubmissionContext containing all the details needed to submit a new application
Returns:
ApplicationId of the accepted application
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException
See Also:
getNewApplication()

killApplication

void killApplication(ApplicationId applicationId)
                     throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Kill an application identified by given ID.

Parameters:
applicationId - ApplicationId of the application that needs to be killed
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException - in case of errors or if YARN rejects the request due to access-control restrictions.
See Also:
getQueueAclsInfo()

getApplicationReport

ApplicationReport getApplicationReport(ApplicationId appId)
                                       throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get a report of the given Application.

In secure mode, YARN verifies access to the application, queue etc. before accepting the request.

If the user does not have VIEW_APP access then the following fields in the report will be set to stubbed values:

Parameters:
appId - ApplicationId of the application that needs a report
Returns:
application report
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getApplicationList

List<ApplicationReport> getApplicationList()
                                           throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get a report (ApplicationReport) of all Applications in the cluster.

If the user does not have VIEW_APP access for an application then the corresponding report will be filtered as described in getApplicationReport(ApplicationId).

Returns:
a list of reports of all running applications
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getYarnClusterMetrics

YarnClusterMetrics getYarnClusterMetrics()
                                         throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get metrics (YarnClusterMetrics) about the cluster.

Returns:
cluster metrics
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getNodeReports

List<NodeReport> getNodeReports()
                                throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get a report of all nodes (NodeReport) in the cluster.

Returns:
A list of report of all nodes
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getRMDelegationToken

DelegationToken getRMDelegationToken(Text renewer)
                                     throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get a delegation token so as to be able to talk to YARN using those tokens.

Parameters:
renewer - Address of the renewer who can renew these tokens when needed by securely talking to YARN.
Returns:
a delegation token (DelegationToken) that can be used to talk to YARN
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getQueueInfo

QueueInfo getQueueInfo(String queueName)
                       throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get information (QueueInfo) about a given queue.

Parameters:
queueName - Name of the queue whose information is needed
Returns:
queue information
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException - in case of errors or if YARN rejects the request due to access-control restrictions.

getAllQueues

List<QueueInfo> getAllQueues()
                             throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get information (QueueInfo) about all queues, recursively if there is a hierarchy

Returns:
a list of queue-information for all queues
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getRootQueueInfos

List<QueueInfo> getRootQueueInfos()
                                  throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get information (QueueInfo) about top level queues.

Returns:
a list of queue-information for all the top-level queues
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getChildQueueInfos

List<QueueInfo> getChildQueueInfos(String parent)
                                   throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get information (QueueInfo) about all the immediate children queues of the given queue

Parameters:
parent - Name of the queue whose child-queues' information is needed
Returns:
a list of queue-information for all queues who are direct children of the given parent queue.
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException

getQueueAclsInfo

List<QueueUserACLInfo> getQueueAclsInfo()
                                        throws org.apache.hadoop.yarn.exceptions.YarnRemoteException

Get information about acls for current user on all the existing queues.

Returns:
a list of queue acls (QueueUserACLInfo) for current user
Throws:
org.apache.hadoop.yarn.exceptions.YarnRemoteException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.