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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onCommitLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId)
    Callback for commit of last re-initialization.
    void
    onCommitLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
    Error Callback for commit of last re-initialization.
    void
    onContainerReInitialize(org.apache.hadoop.yarn.api.records.ContainerId containerId)
    Callback for container re-initialization request.
    void
    onContainerReInitializeError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
    Error Callback for container re-initialization request.
    abstract void
    onContainerResourceIncreased(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.Resource resource)
    Deprecated.
    abstract void
    onContainerResourceUpdated(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 updated.
    void
    onContainerRestart(org.apache.hadoop.yarn.api.records.ContainerId containerId)
    Callback for container restart.
    void
    onContainerRestartError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
    Error Callback for container restart.
    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)
    Deprecated.
    void
    onRollbackLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId)
    Callback for rollback of last re-initialization.
    void
    onRollbackLastReInitializationError(org.apache.hadoop.yarn.api.records.ContainerId containerId, Throwable t)
    Error Callback for rollback of last re-initialization.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 when NodeManager responds to indicate its acceptance of the starting container request.
      Specified by:
      onContainerStarted in interface NMClientAsync.CallbackHandler
      Parameters:
      containerId - the Id of the container
      allServiceResponse - 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 when NodeManager responds with the status of the container.
      Specified by:
      onContainerStatusReceived in interface NMClientAsync.CallbackHandler
      Parameters:
      containerId - the Id of the container
      containerStatus - the status of the container
    • onContainerStopped

      public abstract void onContainerStopped(org.apache.hadoop.yarn.api.records.ContainerId containerId)
      The API is called when NodeManager responds to indicate the container is stopped.
      Specified by:
      onContainerStopped in interface NMClientAsync.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:
      onStartContainerError in interface NMClientAsync.CallbackHandler
      Parameters:
      containerId - the Id of the container
      t - 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 when NodeManager responds to indicate the container resource has been successfully increased.
      Parameters:
      containerId - the Id of the container
      resource - 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 when NodeManager responds to indicate the container resource has been successfully updated.
      Parameters:
      containerId - the Id of the container
      resource - 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:
      onGetContainerStatusError in interface NMClientAsync.CallbackHandler
      Parameters:
      containerId - the Id of the container
      t - 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 container
      t - 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 container
      t - 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:
      onStopContainerError in interface NMClientAsync.CallbackHandler
      Parameters:
      containerId - the Id of the container
      t - 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.