@InterfaceAudience.Private @InterfaceStability.Unstable public class YarnClientImpl extends YarnClient
Service.STATE| Modifier and Type | Field and Description |
|---|---|
protected InetSocketAddress |
rmAddress |
protected ApplicationClientProtocol |
rmClient |
protected long |
statePollIntervalMillis |
| Constructor and Description |
|---|
YarnClientImpl() |
| Modifier and Type | Method and Description |
|---|---|
YarnClientApplication |
createApplication()
Obtain a
YarnClientApplication for a new application,
which in turn contains the ApplicationSubmissionContext and
GetNewApplicationResponse
objects. |
List<QueueInfo> |
getAllQueues()
Get information (
QueueInfo) about all queues, recursively if there
is a hierarchy |
Token<AMRMTokenIdentifier> |
getAMRMToken(ApplicationId appId)
Get the AMRM token of the application.
|
ApplicationReport |
getApplicationReport(ApplicationId appId)
Get a report of the given Application.
|
List<ApplicationReport> |
getApplications()
Get a report (ApplicationReport) of all Applications in the cluster.
|
List<ApplicationReport> |
getApplications(EnumSet<YarnApplicationState> applicationStates)
Get a report (ApplicationReport) of Applications matching the given
application states in the cluster.
|
List<ApplicationReport> |
getApplications(Set<String> applicationTypes)
Get a report (ApplicationReport) of Applications
matching the given application types in the cluster.
|
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.
|
List<QueueInfo> |
getChildQueueInfos(String parent)
Get information (
QueueInfo) about all the immediate children queues
of the given queue |
List<NodeReport> |
getNodeReports(NodeState... states)
Get a report of 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. |
Token |
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.
|
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
void |
setRMClient(ApplicationClientProtocol rmClient) |
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. |
createYarnClientclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected ApplicationClientProtocol rmClient
protected InetSocketAddress rmAddress
protected long statePollIntervalMillis
protected void serviceInit(Configuration conf) throws Exception
AbstractServiceAbstractService.init(Configuration) prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit in class AbstractServiceconf - configurationException - on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart()
throws Exception
AbstractServiceAbstractService.start() prevents re-entrancy.serviceStart in class AbstractServiceException - if needed -these will be caught,
wrapped, and trigger a service stopprotected void serviceStop()
throws Exception
AbstractServiceAbstractService.stop() prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop in class AbstractServiceException - if needed -these will be caught and logged.public YarnClientApplication createApplication() throws YarnException, IOException
YarnClient
Obtain a YarnClientApplication for a new application,
which in turn contains the ApplicationSubmissionContext and
GetNewApplicationResponse
objects.
createApplication in class YarnClientYarnClientApplication built for a new applicationYarnExceptionIOExceptionpublic ApplicationId submitApplication(ApplicationSubmissionContext appContext) throws YarnException, IOException
YarnClient
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.
submitApplication in class YarnClientappContext - ApplicationSubmissionContext containing all the details
needed to submit a new applicationApplicationId of the accepted applicationYarnExceptionIOExceptionYarnClient.createApplication()public void killApplication(ApplicationId applicationId) throws YarnException, IOException
YarnClientKill an application identified by given ID.
killApplication in class YarnClientapplicationId - ApplicationId of the application that needs to be killedYarnException - in case of errors or if YARN rejects the request due to
access-control restrictions.IOExceptionYarnClient.getQueueAclsInfo()public ApplicationReport getApplicationReport(ApplicationId appId) throws YarnException, IOException
YarnClientGet 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:
getApplicationReport in class YarnClientappId - ApplicationId of the application that needs a reportYarnExceptionIOExceptionpublic Token<AMRMTokenIdentifier> getAMRMToken(ApplicationId appId) throws YarnException, IOException
YarnClientUserGroupInformation of the
current user.
The AMRM token will be returned only if all the following conditions are
met:
getAMRMToken in class YarnClientappId - ApplicationId of the application to get the AMRM tokenYarnExceptionIOExceptionpublic List<ApplicationReport> getApplications() throws YarnException, IOException
YarnClientGet 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
YarnClient.getApplicationReport(ApplicationId).
getApplications in class YarnClientYarnExceptionIOExceptionpublic List<ApplicationReport> getApplications(Set<String> applicationTypes) throws YarnException, IOException
YarnClientGet 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
YarnClient.getApplicationReport(ApplicationId).
getApplications in class YarnClientYarnExceptionIOExceptionpublic List<ApplicationReport> getApplications(EnumSet<YarnApplicationState> applicationStates) throws YarnException, IOException
YarnClientGet 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
YarnClient.getApplicationReport(ApplicationId).
getApplications in class YarnClientYarnExceptionIOExceptionpublic List<ApplicationReport> getApplications(Set<String> applicationTypes, EnumSet<YarnApplicationState> applicationStates) throws YarnException, IOException
YarnClientGet 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
YarnClient.getApplicationReport(ApplicationId).
getApplications in class YarnClientYarnExceptionIOExceptionpublic YarnClusterMetrics getYarnClusterMetrics() throws YarnException, IOException
YarnClient
Get metrics (YarnClusterMetrics) about the cluster.
getYarnClusterMetrics in class YarnClientYarnExceptionIOExceptionpublic List<NodeReport> getNodeReports(NodeState... states) throws YarnException, IOException
YarnClient
Get a report of nodes (NodeReport) in the cluster.
getNodeReports in class YarnClientstates - The NodeStates to filter on. If no filter states are
given, nodes in all states will be returned.YarnExceptionIOExceptionpublic Token getRMDelegationToken(Text renewer) throws YarnException, IOException
YarnClientGet a delegation token so as to be able to talk to YARN using those tokens.
getRMDelegationToken in class YarnClientrenewer - Address of the renewer who can renew these tokens when needed by
securely talking to YARN.Token) that can be used to
talk to YARNYarnExceptionIOExceptionpublic QueueInfo getQueueInfo(String queueName) throws YarnException, IOException
YarnClient
Get information (QueueInfo) about a given queue.
getQueueInfo in class YarnClientqueueName - Name of the queue whose information is neededYarnException - in case of errors or if YARN rejects the request due to
access-control restrictions.IOExceptionpublic List<QueueUserACLInfo> getQueueAclsInfo() throws YarnException, IOException
YarnClientGet information about acls for current user on all the existing queues.
getQueueAclsInfo in class YarnClientQueueUserACLInfo) for
current userYarnExceptionIOExceptionpublic List<QueueInfo> getAllQueues() throws YarnException, IOException
YarnClient
Get information (QueueInfo) about all queues, recursively if there
is a hierarchy
getAllQueues in class YarnClientYarnExceptionIOExceptionpublic List<QueueInfo> getRootQueueInfos() throws YarnException, IOException
YarnClient
Get information (QueueInfo) about top level queues.
getRootQueueInfos in class YarnClientYarnExceptionIOExceptionpublic List<QueueInfo> getChildQueueInfos(String parent) throws YarnException, IOException
YarnClient
Get information (QueueInfo) about all the immediate children queues
of the given queue
getChildQueueInfos in class YarnClientparent - Name of the queue whose child-queues' information is neededYarnExceptionIOException@InterfaceAudience.Private public void setRMClient(ApplicationClientProtocol rmClient)
Copyright © 2013 Apache Software Foundation. All rights reserved.