Class Runnables

java.lang.Object
org.apache.flink.runtime.util.Runnables

public class Runnables extends Object
Utils related to Runnable.
  • Constructor Details

    • Runnables

      public Runnables()
  • Method Details

    • assertNoException

      public static void assertNoException(Runnable runnable)
      Asserts that the given Runnable does not throw exceptions. If the runnable throws exceptions, then it will call the FatalExitExceptionHandler.
      Parameters:
      runnable - to assert for no exceptions
    • withUncaughtExceptionHandler

      public static Runnable withUncaughtExceptionHandler(Runnable runnable, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
      Guard Runnable with uncaughtException handler, because ScheduledExecutorService does not respect the one assigned to executing Thread instance.
      Parameters:
      runnable - Runnable future to guard.
      uncaughtExceptionHandler - Handler to call in case of uncaught exception.
      Returns:
      Future with handler.