Class AMRMClientAsync.AbstractCallbackHandler
java.lang.Object
org.apache.hadoop.yarn.client.api.async.AMRMClientAsync.AbstractCallbackHandler
- All Implemented Interfaces:
AMRMClientAsync.CallbackHandler
- Enclosing class:
- AMRMClientAsync<T extends AMRMClient.ContainerRequest>
public abstract static class AMRMClientAsync.AbstractCallbackHandler
extends Object
implements AMRMClientAsync.CallbackHandler
The callback abstract class. The callback functions need to be implemented
by AMRMClientAsync users. The APIs are called when responses from
the ResourceManager are available.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract floatabstract voidonContainersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers) Called when the ResourceManager responds to a heartbeat with allocated containers.abstract voidonContainersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses) Called when the ResourceManager responds to a heartbeat with completed containers.voidonContainersReceivedFromPreviousAttempts(List<org.apache.hadoop.yarn.api.records.Container> containers) Called when the ResourceManager responds to a heartbeat with containers from previous attempt.abstract voidonContainersUpdated(List<org.apache.hadoop.yarn.api.records.UpdatedContainer> containers) Called when the ResourceManager responds to a heartbeat with containers whose resource allocation has been changed.abstract voidCalled when error comes from RM communications as well as from errors in the callback itself from the app.abstract voidonNodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes) Called when nodes tracked by the ResourceManager have changed in health, availability etc.voidonPreemptionMessageReceived(org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionMessage) Called when the RM responds to a heartbeat with preemption messagevoidonRequestsRejected(List<org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest> rejectedSchedulingRequests) Called when the RM has rejected Scheduling Requests.abstract voidCalled when the ResourceManager wants the ApplicationMaster to shutdown for being out of sync etc.
-
Constructor Details
-
AbstractCallbackHandler
public AbstractCallbackHandler()
-
-
Method Details
-
onContainersCompleted
public abstract void onContainersCompleted(List<org.apache.hadoop.yarn.api.records.ContainerStatus> statuses) Called when the ResourceManager responds to a heartbeat with completed containers. If the response contains both completed containers and allocated containers, this will be called before containersAllocated.- Specified by:
onContainersCompletedin interfaceAMRMClientAsync.CallbackHandler
-
onContainersAllocated
public abstract void onContainersAllocated(List<org.apache.hadoop.yarn.api.records.Container> containers) Called when the ResourceManager responds to a heartbeat with allocated containers. If the response containers both completed containers and allocated containers, this will be called after containersCompleted.- Specified by:
onContainersAllocatedin interfaceAMRMClientAsync.CallbackHandler
-
onContainersUpdated
@Public @Unstable public abstract void onContainersUpdated(List<org.apache.hadoop.yarn.api.records.UpdatedContainer> containers) Called when the ResourceManager responds to a heartbeat with containers whose resource allocation has been changed. -
onShutdownRequest
public abstract void onShutdownRequest()Called when the ResourceManager wants the ApplicationMaster to shutdown for being out of sync etc. The ApplicationMaster should not unregister with the RM unless the ApplicationMaster wants to be the last attempt.- Specified by:
onShutdownRequestin interfaceAMRMClientAsync.CallbackHandler
-
onNodesUpdated
public abstract void onNodesUpdated(List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes) Called when nodes tracked by the ResourceManager have changed in health, availability etc.- Specified by:
onNodesUpdatedin interfaceAMRMClientAsync.CallbackHandler
-
getProgress
public abstract float getProgress()- Specified by:
getProgressin interfaceAMRMClientAsync.CallbackHandler
-
onError
Called when error comes from RM communications as well as from errors in the callback itself from the app. Calling stop() is the recommended action.- Specified by:
onErrorin interfaceAMRMClientAsync.CallbackHandler
-
onContainersReceivedFromPreviousAttempts
public void onContainersReceivedFromPreviousAttempts(List<org.apache.hadoop.yarn.api.records.Container> containers) Called when the ResourceManager responds to a heartbeat with containers from previous attempt. -
onRequestsRejected
@Public @Unstable public void onRequestsRejected(List<org.apache.hadoop.yarn.api.records.RejectedSchedulingRequest> rejectedSchedulingRequests) Called when the RM has rejected Scheduling Requests.- Parameters:
rejectedSchedulingRequests- Rejected Scheduling Requests.
-
onPreemptionMessageReceived
@Public @Unstable public void onPreemptionMessageReceived(org.apache.hadoop.yarn.api.records.PreemptionMessage preemptionMessage) Called when the RM responds to a heartbeat with preemption message- Parameters:
preemptionMessage-
-