@InterfaceStability.Unstable public class AMRMClientImpl extends org.apache.hadoop.yarn.service.AbstractService implements AMRMClient
AMRMClient.ContainerRequest| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
appAttemptId |
protected Set<org.apache.hadoop.yarn.api.records.ResourceRequest> |
ask |
protected org.apache.hadoop.yarn.api.records.Resource |
clusterAvailableResources |
protected int |
clusterNodeCount |
protected Set<org.apache.hadoop.yarn.api.records.ContainerId> |
release |
protected Map<org.apache.hadoop.yarn.api.records.Priority,Map<String,Map<org.apache.hadoop.yarn.api.records.Resource,org.apache.hadoop.yarn.api.records.ResourceRequest>>> |
remoteRequestsTable |
protected org.apache.hadoop.yarn.api.AMRMProtocol |
rmClient |
ANY| Constructor and Description |
|---|
AMRMClientImpl(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainerRequest(AMRMClient.ContainerRequest req)
Request containers for resources before calling
allocate |
org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse |
allocate(float progressIndicator)
Request additional containers and receive new container allocations.
|
org.apache.hadoop.yarn.api.records.Resource |
getClusterAvailableResources()
Get the currently available resources in the cluster.
|
int |
getClusterNodeCount()
Get the current number of nodes in the cluster.
|
void |
init(org.apache.hadoop.conf.Configuration conf) |
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse |
registerApplicationMaster(String appHostName,
int appHostPort,
String appTrackingUrl)
Register the application master.
|
void |
releaseAssignedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Release containers assigned by the Resource Manager.
|
void |
removeContainerRequest(AMRMClient.ContainerRequest req)
Remove previous container request.
|
void |
start() |
void |
stop() |
void |
unregisterApplicationMaster(org.apache.hadoop.yarn.api.records.FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
Unregister the application master.
|
getConfig, getName, getServiceState, getStartTime, register, unregisterprotected org.apache.hadoop.yarn.api.AMRMProtocol rmClient
protected final org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId
protected org.apache.hadoop.yarn.api.records.Resource clusterAvailableResources
protected int clusterNodeCount
protected final Map<org.apache.hadoop.yarn.api.records.Priority,Map<String,Map<org.apache.hadoop.yarn.api.records.Resource,org.apache.hadoop.yarn.api.records.ResourceRequest>>> remoteRequestsTable
protected final Set<org.apache.hadoop.yarn.api.records.ResourceRequest> ask
protected final Set<org.apache.hadoop.yarn.api.records.ContainerId> release
public AMRMClientImpl(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
public void init(org.apache.hadoop.conf.Configuration conf)
init in interface org.apache.hadoop.yarn.service.Serviceinit in class org.apache.hadoop.yarn.service.AbstractServicepublic void start()
start in interface org.apache.hadoop.yarn.service.Servicestart in class org.apache.hadoop.yarn.service.AbstractServicepublic void stop()
stop in interface org.apache.hadoop.yarn.service.Servicestop in class org.apache.hadoop.yarn.service.AbstractServicepublic org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(String appHostName, int appHostPort, String appTrackingUrl) throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
AMRMClientregisterApplicationMaster in interface AMRMClientappHostName - Name of the host on which master is runningappHostPort - Port master is listening onappTrackingUrl - URL at which the master info can be seenRegisterApplicationMasterResponseorg.apache.hadoop.yarn.exceptions.YarnRemoteExceptionpublic org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(float progressIndicator)
throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
AMRMClientaddContainerRequest are sent to the
ResourceManager. New containers assigned to the master are
retrieved. Status of completed containers and node health updates are
also retrieved.
This also doubles up as a heartbeat to the ResourceManager and must be
made periodically.
The call may not always return any new allocations of containers.
App should not make concurrent allocate requests. May cause request loss.allocate in interface AMRMClientprogressIndicator - Indicates progress made by the masterorg.apache.hadoop.yarn.exceptions.YarnRemoteExceptionpublic void unregisterApplicationMaster(org.apache.hadoop.yarn.api.records.FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
AMRMClientunregisterApplicationMaster in interface AMRMClientappStatus - Success/Failure status of the masterappMessage - Diagnostics message on failureappTrackingUrl - New URL to get master infoorg.apache.hadoop.yarn.exceptions.YarnRemoteExceptionpublic void addContainerRequest(AMRMClient.ContainerRequest req)
AMRMClientallocateaddContainerRequest in interface AMRMClientreq - Resource requestpublic void removeContainerRequest(AMRMClient.ContainerRequest req)
AMRMClientremoveContainerRequest in interface AMRMClientreq - Resource requestpublic void releaseAssignedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
AMRMClientreleaseAssignedContainer in interface AMRMClientpublic org.apache.hadoop.yarn.api.records.Resource getClusterAvailableResources()
AMRMClientgetClusterAvailableResources in interface AMRMClientpublic int getClusterNodeCount()
AMRMClientgetClusterNodeCount in interface AMRMClientCopyright © 2013 Apache Software Foundation. All Rights Reserved.