Class NMClientAsync.AbstractCallbackHandler
java.lang.Object
org.apache.hadoop.yarn.client.api.async.NMClientAsync.AbstractCallbackHandler
- All Implemented Interfaces:
NMClientAsync.CallbackHandler
- Enclosing class:
- NMClientAsync
public abstract static class NMClientAsync.AbstractCallbackHandler
extends Object
implements NMClientAsync.CallbackHandler
The callback abstract class. The callback functions need to be implemented
by NMClientAsync users. The APIs are called when responses from
NodeManager are available.
Once a callback happens, the users can chose to act on it in blocking or non-blocking manner. If the action on callback is done in a blocking manner, some of the threads performing requests on NodeManagers may get blocked depending on how many threads in the pool are busy.
The implementation of the callback functions should not throw the
unexpected exception. Otherwise, NMClientAsync will just
catch, log and then ignore it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonCommitLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for commit of last re-initialization.voidonCommitLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for commit of last re-initialization.voidonContainerReInitialize(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for container re-initialization request.voidonContainerReInitializeError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for container re-initialization request.abstract voidonContainerResourceIncreased(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource) Deprecated.abstract voidonContainerResourceUpdated(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource) The API is called whenNodeManagerresponds to indicate the container resource has been successfully updated.voidonContainerRestart(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for container restart.voidonContainerRestartError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for container restart.abstract voidonContainerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) The API is called whenNodeManagerresponds to indicate its acceptance of the starting container request.abstract voidonContainerStatusReceived(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus) The API is called whenNodeManagerresponds with the status of the container.abstract voidonContainerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId) The API is called whenNodeManagerresponds to indicate the container is stopped.abstract voidonGetContainerStatusError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of querying the status of a container.abstract voidonIncreaseContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Deprecated.voidonRollbackLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for rollback of last re-initialization.voidonRollbackLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for rollback of last re-initialization.abstract voidonStartContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of starting a container.abstract voidonStopContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of stopping a container.abstract voidonUpdateContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of updating container resource.
-
Constructor Details
-
AbstractCallbackHandler
public AbstractCallbackHandler()
-
-
Method Details
-
onContainerStarted
public abstract void onContainerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) The API is called whenNodeManagerresponds to indicate its acceptance of the starting container request.- Specified by:
onContainerStartedin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the containerallServiceResponse- a Map between the auxiliary service names and their outputs
-
onContainerStatusReceived
public abstract void onContainerStatusReceived(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus) The API is called whenNodeManagerresponds with the status of the container.- Specified by:
onContainerStatusReceivedin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the containercontainerStatus- the status of the container
-
onContainerStopped
public abstract void onContainerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId) The API is called whenNodeManagerresponds to indicate the container is stopped.- Specified by:
onContainerStoppedin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the container
-
onStartContainerError
public abstract void onStartContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of starting a container.- Specified by:
onStartContainerErrorin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the containert- the raised exception
-
onContainerResourceIncreased
@Deprecated public abstract void onContainerResourceIncreased(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource) Deprecated.The API is called whenNodeManagerresponds to indicate the container resource has been successfully increased.- Parameters:
containerId- the Id of the containerresource- the target resource of the container
-
onContainerResourceUpdated
public abstract void onContainerResourceUpdated(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource) The API is called whenNodeManagerresponds to indicate the container resource has been successfully updated.- Parameters:
containerId- the Id of the containerresource- the target resource of the container
-
onGetContainerStatusError
public abstract void onGetContainerStatusError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of querying the status of a container.- Specified by:
onGetContainerStatusErrorin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the containert- the raised exception
-
onIncreaseContainerResourceError
@Deprecated public abstract void onIncreaseContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Deprecated.The API is called when an exception is raised in the process of increasing container resource.- Parameters:
containerId- the Id of the containert- the raised exception
-
onUpdateContainerResourceError
public abstract void onUpdateContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of updating container resource.- Parameters:
containerId- the Id of the containert- the raised exception
-
onStopContainerError
public abstract void onStopContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) The API is called when an exception is raised in the process of stopping a container.- Specified by:
onStopContainerErrorin interfaceNMClientAsync.CallbackHandler- Parameters:
containerId- the Id of the containert- the raised exception
-
onContainerReInitialize
public void onContainerReInitialize(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for container re-initialization request.- Parameters:
containerId- the Id of the container to be Re-Initialized.
-
onContainerRestart
public void onContainerRestart(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for container restart.- Parameters:
containerId- the Id of the container to restart.
-
onRollbackLastReInitialization
public void onRollbackLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for rollback of last re-initialization.- Parameters:
containerId- the Id of the container to restart.
-
onCommitLastReInitialization
public void onCommitLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) Callback for commit of last re-initialization.- Parameters:
containerId- the Id of the container to commit reInitialize.
-
onContainerReInitializeError
public void onContainerReInitializeError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for container re-initialization request.- Parameters:
containerId- the Id of the container to be Re-Initialized.t- a Throwable.
-
onContainerRestartError
public void onContainerRestartError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for container restart.- Parameters:
containerId- the Id of the container to restart.t- a Throwable.
-
onRollbackLastReInitializationError
public void onRollbackLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for rollback of last re-initialization.- Parameters:
containerId- the Id of the container to restart.t- a Throwable.
-
onCommitLastReInitializationError
public void onCommitLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t) Error Callback for commit of last re-initialization.- Parameters:
containerId- the Id of the container to commit reInitialize.t- a Throwable.
-