@InterfaceAudience.Public
@InterfaceStability.Unstable
public interface AMRMClient
extends org.apache.hadoop.yarn.service.Service
| Modifier and Type | Interface and Description |
|---|---|
static class |
AMRMClient.ContainerRequest
Object to represent container request for resources.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ANY
Value used to define no locality
|
| 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.
|
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 |
unregisterApplicationMaster(org.apache.hadoop.yarn.api.records.FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
Unregister the application master.
|
static final String ANY
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(String appHostName, int appHostPort, String appTrackingUrl) throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
appHostName - 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.YarnRemoteExceptionorg.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(float progressIndicator)
throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
addContainerRequest 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.progressIndicator - Indicates progress made by the masterorg.apache.hadoop.yarn.exceptions.YarnRemoteExceptionvoid unregisterApplicationMaster(org.apache.hadoop.yarn.api.records.FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
throws org.apache.hadoop.yarn.exceptions.YarnRemoteException
appStatus - Success/Failure status of the masterappMessage - Diagnostics message on failureappTrackingUrl - New URL to get master infoorg.apache.hadoop.yarn.exceptions.YarnRemoteExceptionvoid addContainerRequest(AMRMClient.ContainerRequest req)
allocatereq - Resource requestvoid removeContainerRequest(AMRMClient.ContainerRequest req)
req - Resource requestvoid releaseAssignedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - org.apache.hadoop.yarn.api.records.Resource getClusterAvailableResources()
int getClusterNodeCount()
Copyright © 2013 Apache Software Foundation. All Rights Reserved.