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 and Description |
---|
AbstractCallbackHandler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
onContainerResourceIncreased(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.api.records.Resource resource)
The API is called when
NodeManager responds to indicate
the container resource has been successfully increased. |
abstract void |
onContainerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Map<String,ByteBuffer> allServiceResponse)
The API is called when
NodeManager responds to indicate its
acceptance of the starting container request. |
abstract void |
onContainerStatusReceived(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus)
The API is called when
NodeManager responds with the status
of the container. |
abstract void |
onContainerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)
The API is called when
NodeManager responds to indicate the
container is stopped. |
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.
|
abstract void |
onIncreaseContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Throwable t)
The API is called when an exception is raised in the process of
increasing container resource.
|
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.
|
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.
|
public abstract void onContainerStarted(org.apache.hadoop.yarn.api.records.ContainerId containerId, Map<String,ByteBuffer> allServiceResponse)
NodeManager
responds to indicate its
acceptance of the starting container request.onContainerStarted
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containerallServiceResponse
- a Map between the auxiliary service names and
their outputspublic abstract void onContainerStatusReceived(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus)
NodeManager
responds with the status
of the container.onContainerStatusReceived
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containercontainerStatus
- the status of the containerpublic abstract void onContainerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)
NodeManager
responds to indicate the
container is stopped.onContainerStopped
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containerpublic abstract void onStartContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
onStartContainerError
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containert
- the raised exceptionpublic abstract void onContainerResourceIncreased(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource)
NodeManager
responds to indicate
the container resource has been successfully increased.containerId
- the Id of the containerresource
- the target resource of the containerpublic abstract void onGetContainerStatusError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
onGetContainerStatusError
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containert
- the raised exceptionpublic abstract void onIncreaseContainerResourceError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
containerId
- the Id of the containert
- the raised exceptionpublic abstract void onStopContainerError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
onStopContainerError
in interface NMClientAsync.CallbackHandler
containerId
- the Id of the containert
- the raised exceptionCopyright © 2017 Apache Software Foundation. All Rights Reserved.