@InterfaceAudience.Public @InterfaceStability.Stable public abstract class AMRMClient<T extends AMRMClient.ContainerRequest> extends AbstractService
Modifier and Type | Class and Description |
---|---|
static class |
AMRMClient.ContainerRequest
Object to represent a single container request for resources.
|
Service.STATE
Modifier | Constructor and Description |
---|---|
protected |
AMRMClient(String name) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addContainerRequest(T req)
Request containers for resources before calling
allocate |
abstract AllocateResponse |
allocate(float progressIndicator)
Request additional containers and receive new container allocations.
|
static <T extends AMRMClient.ContainerRequest> |
createAMRMClient()
Create a new instance of AMRMClient.
|
abstract Resource |
getAvailableResources()
Get the currently available resources in the cluster.
|
abstract int |
getClusterNodeCount()
Get the current number of nodes in the cluster.
|
abstract List<? extends Collection<T>> |
getMatchingRequests(Priority priority,
String resourceName,
Resource capability)
Get outstanding
ContainerRequest s matching the given
parameters. |
abstract RegisterApplicationMasterResponse |
registerApplicationMaster(String appHostName,
int appHostPort,
String appTrackingUrl)
Register the application master.
|
abstract void |
releaseAssignedContainer(ContainerId containerId)
Release containers assigned by the Resource Manager.
|
abstract void |
removeContainerRequest(T req)
Remove previous container request.
|
abstract void |
unregisterApplicationMaster(FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
Unregister the application master.
|
abstract void |
updateBlacklist(List<String> blacklistAdditions,
List<String> blacklistRemovals)
Update application's blacklist with addition or removal resources.
|
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 AMRMClient(String name)
@InterfaceAudience.Public public static <T extends AMRMClient.ContainerRequest> AMRMClient<T> createAMRMClient()
AMRMClient.<T>createAMRMClientContainerRequest()
public abstract RegisterApplicationMasterResponse registerApplicationMaster(String appHostName, int appHostPort, String appTrackingUrl) throws YarnException, IOException
appHostName
- Name of the host on which master is runningappHostPort
- Port master is listening onappTrackingUrl
- URL at which the master info can be seenRegisterApplicationMasterResponse
YarnException
IOException
public abstract AllocateResponse allocate(float progressIndicator) throws YarnException, IOException
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 masterYarnException
IOException
public abstract void unregisterApplicationMaster(FinalApplicationStatus appStatus, String appMessage, String appTrackingUrl) throws YarnException, IOException
appStatus
- Success/Failure status of the masterappMessage
- Diagnostics message on failureappTrackingUrl
- New URL to get master infoYarnException
IOException
public abstract void addContainerRequest(T req)
allocate
req
- Resource requestpublic abstract void removeContainerRequest(T req)
req
- Resource requestpublic abstract void releaseAssignedContainer(ContainerId containerId)
containerId
- public abstract Resource getAvailableResources()
public abstract int getClusterNodeCount()
public abstract List<? extends Collection<T>> getMatchingRequests(Priority priority, String resourceName, Resource capability)
ContainerRequest
s matching the given
parameters. These ContainerRequests should have been added via
addContainerRequest
earlier in the lifecycle. For performance,
the AMRMClient may return its internal collection directly without creating
a copy. Users should not perform mutable operations on the return value.
Each collection in the list contains requests with identical
Resource
size that fit in the given capability. In a
collection, requests will be returned in the same order as they were added.public abstract void updateBlacklist(List<String> blacklistAdditions, List<String> blacklistRemovals)
blacklistAdditions
- list of resources which should be added to the
application blacklistblacklistRemovals
- list of resources which should be removed from the
application blacklistCopyright © 2013 Apache Software Foundation. All rights reserved.