public class ResourceMgrDelegate extends YarnClient
Service.STATE| Modifier and Type | Field and Description |
|---|---|
protected YarnClient |
client |
| Constructor and Description |
|---|
ResourceMgrDelegate(YarnConfiguration conf)
Delegate responsible for communicating with the Resource Manager's
ApplicationClientProtocol. |
| Modifier and Type | Method and Description |
|---|---|
YarnClientApplication |
createApplication()
Obtain a
YarnClientApplication for a new application,
which in turn contains the ApplicationSubmissionContext and
GetNewApplicationResponse
objects. |
TaskTrackerInfo[] |
getActiveTrackers() |
JobStatus[] |
getAllJobs() |
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.
|
ApplicationId |
getApplicationId() |
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.
|
TaskTrackerInfo[] |
getBlacklistedTrackers() |
List<QueueInfo> |
getChildQueueInfos(String parent)
Get information (
QueueInfo) about all the immediate children queues
of the given queue |
QueueInfo[] |
getChildQueues(String parent) |
ClusterMetrics |
getClusterMetrics() |
Token |
getDelegationToken(Text renewer) |
String |
getFilesystemName() |
JobID |
getNewJobID() |
List<NodeReport> |
getNodeReports(NodeState... states)
Get a report of nodes (
NodeReport) in the cluster. |
long |
getProtocolVersion(String arg0,
long arg1) |
QueueInfo |
getQueue(String queueName) |
QueueAclsInfo[] |
getQueueAclsForCurrentUser() |
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. |
QueueInfo[] |
getQueues() |
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. |
QueueInfo[] |
getRootQueues() |
String |
getStagingAreaDir() |
String |
getSystemDir() |
long |
getTaskTrackerExpiryInterval() |
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 |
setJobPriority(JobID arg0,
String arg1) |
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, waitForServiceToStop@InterfaceAudience.Private protected YarnClient client
public ResourceMgrDelegate(YarnConfiguration conf)
ApplicationClientProtocol.conf - the configuration object.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 TaskTrackerInfo[] getActiveTrackers() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic JobStatus[] getAllJobs() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic TaskTrackerInfo[] getBlacklistedTrackers() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic ClusterMetrics getClusterMetrics() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Token getDelegationToken(Text renewer) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String getFilesystemName() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic JobID getNewJobID() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic QueueInfo getQueue(String queueName) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic QueueInfo[] getQueues() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic QueueInfo[] getRootQueues() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic QueueInfo[] getChildQueues(String parent) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String getStagingAreaDir() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String getSystemDir() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic long getTaskTrackerExpiryInterval()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void setJobPriority(JobID arg0, String arg1) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic long getProtocolVersion(String arg0, long arg1) throws IOException
IOExceptionpublic ApplicationId getApplicationId()
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<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 neededYarnExceptionIOExceptionpublic List<QueueUserACLInfo> getQueueAclsInfo() throws YarnException, IOException
YarnClientGet information about acls for current user on all the existing queues.
getQueueAclsInfo in class YarnClientQueueUserACLInfo) for
current userYarnExceptionIOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.