Class HadoopUncaughtExceptionHandler

java.lang.Object
org.apache.hadoop.service.launcher.HadoopUncaughtExceptionHandler
All Implemented Interfaces:
Thread.UncaughtExceptionHandler

@Public @Evolving public class HadoopUncaughtExceptionHandler extends Object implements Thread.UncaughtExceptionHandler
This class is intended to be installed by calling Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler) in the main entry point. The base class will always attempt to shut down the process if an Error was raised; the behavior on a standard Exception, raised outside process shutdown, is simply to log it. (Based on the class YarnUncaughtExceptionHandler)
  • Constructor Details

    • HadoopUncaughtExceptionHandler

      public HadoopUncaughtExceptionHandler(Thread.UncaughtExceptionHandler delegate)
      Create an instance delegating to the supplied handler if the exception is considered "simple".
      Parameters:
      delegate - a delegate exception handler.
    • HadoopUncaughtExceptionHandler

      public HadoopUncaughtExceptionHandler()
      Basic exception handler -logs simple exceptions, then continues.
  • Method Details

    • uncaughtException

      public void uncaughtException(Thread thread, Throwable exception)
      Uncaught exception handler. If an error is raised: shutdown The state of the system is unknown at this point -attempting a clean shutdown is dangerous. Instead: exit
      Specified by:
      uncaughtException in interface Thread.UncaughtExceptionHandler
      Parameters:
      thread - thread that failed
      exception - the raised exception