@InterfaceAudience.Private @InterfaceStability.Unstable public class AMRMClientAsyncImpl<T extends AMRMClient.ContainerRequest> extends AMRMClientAsync<T>
AMRMClientAsync.CallbackHandlerService.STATEclient, handler, heartbeatIntervalMs| Constructor and Description |
|---|
AMRMClientAsyncImpl(AMRMClient<T> client,
int intervalMs,
AMRMClientAsync.CallbackHandler callbackHandler) |
AMRMClientAsyncImpl(int intervalMs,
AMRMClientAsync.CallbackHandler callbackHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainerRequest(T req)
Request containers for resources before calling
allocate |
Resource |
getAvailableResources()
Get the currently available resources in the cluster.
|
int |
getClusterNodeCount()
Get the current number of nodes in the cluster.
|
List<? extends Collection<T>> |
getMatchingRequests(Priority priority,
String resourceName,
Resource capability) |
RegisterApplicationMasterResponse |
registerApplicationMaster(String appHostName,
int appHostPort,
String appTrackingUrl)
Registers this application master with the resource manager.
|
void |
releaseAssignedContainer(ContainerId containerId)
Release containers assigned by the Resource Manager.
|
void |
removeContainerRequest(T req)
Remove previous container request.
|
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()
Tells the heartbeat and handler threads to stop and waits for them to
terminate.
|
void |
setHeartbeatInterval(int interval) |
void |
unregisterApplicationMaster(FinalApplicationStatus appStatus,
String appMessage,
String appTrackingUrl)
Unregister the application master.
|
createAMRMClientAsync, createAMRMClientAsyncclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic AMRMClientAsyncImpl(int intervalMs,
AMRMClientAsync.CallbackHandler callbackHandler)
@InterfaceAudience.Private public AMRMClientAsyncImpl(AMRMClient<T> client, int intervalMs, AMRMClientAsync.CallbackHandler callbackHandler)
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
serviceStop in class AbstractServiceException - if needed -these will be caught and logged.public void setHeartbeatInterval(int interval)
setHeartbeatInterval in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>public List<? extends Collection<T>> getMatchingRequests(Priority priority, String resourceName, Resource capability)
getMatchingRequests in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>public RegisterApplicationMasterResponse registerApplicationMaster(String appHostName, int appHostPort, String appTrackingUrl) throws YarnException, IOException
registerApplicationMaster in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>YarnExceptionIOExceptionpublic void unregisterApplicationMaster(FinalApplicationStatus appStatus, String appMessage, String appTrackingUrl) throws YarnException, IOException
unregisterApplicationMaster in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>appStatus - Success/Failure status of the masterappMessage - Diagnostics message on failureappTrackingUrl - New URL to get master infoYarnExceptionIOExceptionpublic void addContainerRequest(T req)
allocateaddContainerRequest in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>req - Resource requestpublic void removeContainerRequest(T req)
removeContainerRequest in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>req - Resource requestpublic void releaseAssignedContainer(ContainerId containerId)
releaseAssignedContainer in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>containerId - public Resource getAvailableResources()
getAvailableResources in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>public int getClusterNodeCount()
getClusterNodeCount in class AMRMClientAsync<T extends AMRMClient.ContainerRequest>Copyright © 2013 Apache Software Foundation. All rights reserved.