Package org.apache.flink.runtime.util
Class Runnables
- java.lang.Object
-
- org.apache.flink.runtime.util.Runnables
-
-
Constructor Summary
Constructors Constructor Description Runnables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertNoException(Runnable runnable)Asserts that the givenRunnabledoes not throw exceptions.static RunnablewithUncaughtExceptionHandler(Runnable runnable, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)GuardRunnablewith uncaughtException handler, becauseScheduledExecutorServicedoes not respect the one assigned to executingThreadinstance.
-
-
-
Method Detail
-
assertNoException
public static void assertNoException(Runnable runnable)
Asserts that the givenRunnabledoes not throw exceptions. If the runnable throws exceptions, then it will call theFatalExitExceptionHandler.- Parameters:
runnable- to assert for no exceptions
-
withUncaughtExceptionHandler
public static Runnable withUncaughtExceptionHandler(Runnable runnable, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
GuardRunnablewith uncaughtException handler, becauseScheduledExecutorServicedoes not respect the one assigned to executingThreadinstance.- Parameters:
runnable- Runnable future to guard.uncaughtExceptionHandler- Handler to call in case of uncaught exception.- Returns:
- Future with handler.
-
-