@InterfaceAudience.Public @InterfaceStability.Stable public abstract class YarnClient extends AbstractService
Service.STATE
Modifier | Constructor and Description |
---|---|
protected |
YarnClient(String name) |
Modifier and Type | Method and Description |
---|---|
abstract YarnClientApplication |
createApplication()
Obtain a
YarnClientApplication for a new application,
which in turn contains the ApplicationSubmissionContext and
GetNewApplicationResponse
objects. |
static YarnClient |
createYarnClient()
Create a new instance of YarnClient.
|
abstract List<QueueInfo> |
getAllQueues()
Get information (
QueueInfo ) about all queues, recursively if there
is a hierarchy |
abstract Token<AMRMTokenIdentifier> |
getAMRMToken(ApplicationId appId)
Get the AMRM token of the application.
|
abstract ApplicationReport |
getApplicationReport(ApplicationId appId)
Get a report of the given Application.
|
abstract List<ApplicationReport> |
getApplications()
Get a report (ApplicationReport) of all Applications in the cluster.
|
abstract List<ApplicationReport> |
getApplications(EnumSet<YarnApplicationState> applicationStates)
Get a report (ApplicationReport) of Applications matching the given
application states in the cluster.
|
abstract List<ApplicationReport> |
getApplications(Set<String> applicationTypes)
Get a report (ApplicationReport) of Applications
matching the given application types in the cluster.
|
abstract List<ApplicationReport> |
getApplications(Set<String> applicationTypes,
EnumSet<YarnApplicationState> applicationStates)
Get a report (ApplicationReport) of Applications matching the given
application types and application states in the cluster.
|
abstract List<QueueInfo> |
getChildQueueInfos(String parent)
Get information (
QueueInfo ) about all the immediate children queues
of the given queue |
abstract List<NodeReport> |
getNodeReports(NodeState... states)
Get a report of nodes (
NodeReport ) in the cluster. |
abstract List<QueueUserACLInfo> |
getQueueAclsInfo()
Get information about acls for current user on all the
existing queues.
|
abstract QueueInfo |
getQueueInfo(String queueName)
Get information (
QueueInfo ) about a given queue. |
abstract Token |
getRMDelegationToken(Text renewer)
Get a delegation token so as to be able to talk to YARN using those tokens.
|
abstract List<QueueInfo> |
getRootQueueInfos()
Get information (
QueueInfo ) about top level queues. |
abstract YarnClusterMetrics |
getYarnClusterMetrics()
Get metrics (
YarnClusterMetrics ) about the cluster. |
abstract void |
killApplication(ApplicationId applicationId)
Kill an application identified by given ID.
|
abstract ApplicationId |
submitApplication(ApplicationSubmissionContext appContext)
Submit a new application to
YARN. It is a blocking call, such
that it will not return ApplicationId until the submitted
application has been submitted and accepted by the ResourceManager. |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
@InterfaceAudience.Private protected YarnClient(String name)
@InterfaceAudience.Public public static YarnClient createYarnClient()
public abstract YarnClientApplication createApplication() throws YarnException, IOException
Obtain a YarnClientApplication
for a new application,
which in turn contains the ApplicationSubmissionContext
and
GetNewApplicationResponse
objects.
YarnClientApplication
built for a new applicationYarnException
IOException
public abstract ApplicationId submitApplication(ApplicationSubmissionContext appContext) throws YarnException, IOException
Submit a new application to YARN.
It is a blocking call, such
that it will not return ApplicationId
until the submitted
application has been submitted and accepted by the ResourceManager.
appContext
- ApplicationSubmissionContext
containing all the details
needed to submit a new applicationApplicationId
of the accepted applicationYarnException
IOException
createApplication()
public abstract void killApplication(ApplicationId applicationId) throws YarnException, IOException
Kill an application identified by given ID.
applicationId
- ApplicationId
of the application that needs to be killedYarnException
- in case of errors or if YARN rejects the request due to
access-control restrictions.IOException
getQueueAclsInfo()
public abstract ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException
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:
appId
- ApplicationId
of the application that needs a reportYarnException
IOException
public abstract Token<AMRMTokenIdentifier> getAMRMToken(ApplicationId appId) throws YarnException, IOException
UserGroupInformation
of the
current user.
The AMRM token will be returned only if all the following conditions are
met:
appId
- ApplicationId
of the application to get the AMRM tokenYarnException
IOException
public abstract List<ApplicationReport> getApplications() throws YarnException, IOException
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)
.
YarnException
IOException
public abstract List<ApplicationReport> getApplications(Set<String> applicationTypes) throws YarnException, IOException
Get a report (ApplicationReport) of Applications matching the given application types 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)
.
applicationTypes
- YarnException
IOException
public abstract List<ApplicationReport> getApplications(EnumSet<YarnApplicationState> applicationStates) throws YarnException, IOException
Get a report (ApplicationReport) of Applications matching the given application states 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)
.
applicationStates
- YarnException
IOException
public abstract List<ApplicationReport> getApplications(Set<String> applicationTypes, EnumSet<YarnApplicationState> applicationStates) throws YarnException, IOException
Get a report (ApplicationReport) of Applications matching the given application types and application states 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)
.
applicationTypes
- applicationStates
- YarnException
IOException
public abstract YarnClusterMetrics getYarnClusterMetrics() throws YarnException, IOException
Get metrics (YarnClusterMetrics
) about the cluster.
YarnException
IOException
public abstract List<NodeReport> getNodeReports(NodeState... states) throws YarnException, IOException
Get a report of nodes (NodeReport
) in the cluster.
states
- The NodeState
s to filter on. If no filter states are
given, nodes in all states will be returned.YarnException
IOException
public abstract Token getRMDelegationToken(Text renewer) throws YarnException, IOException
Get a delegation token so as to be able to talk to YARN using those tokens.
renewer
- Address of the renewer who can renew these tokens when needed by
securely talking to YARN.Token
) that can be used to
talk to YARNYarnException
IOException
public abstract QueueInfo getQueueInfo(String queueName) throws YarnException, IOException
Get information (QueueInfo
) about a given queue.
queueName
- Name of the queue whose information is neededYarnException
- in case of errors or if YARN rejects the request due to
access-control restrictions.IOException
public abstract List<QueueInfo> getAllQueues() throws YarnException, IOException
Get information (QueueInfo
) about all queues, recursively if there
is a hierarchy
YarnException
IOException
public abstract List<QueueInfo> getRootQueueInfos() throws YarnException, IOException
Get information (QueueInfo
) about top level queues.
YarnException
IOException
public abstract List<QueueInfo> getChildQueueInfos(String parent) throws YarnException, IOException
Get information (QueueInfo
) about all the immediate children queues
of the given queue
parent
- Name of the queue whose child-queues' information is neededYarnException
IOException
public abstract List<QueueUserACLInfo> getQueueAclsInfo() throws YarnException, IOException
Get information about acls for current user on all the existing queues.
QueueUserACLInfo
) for
current userYarnException
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.