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 void
assertNoException(Runnable runnable)
Asserts that the givenRunnable
does not throw exceptions.static Runnable
withUncaughtExceptionHandler(Runnable runnable, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
GuardRunnable
with uncaughtException handler, becauseScheduledExecutorService
does not respect the one assigned to executingThread
instance.
-
-
-
Method Detail
-
assertNoException
public static void assertNoException(Runnable runnable)
Asserts that the givenRunnable
does 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)
GuardRunnable
with uncaughtException handler, becauseScheduledExecutorService
does not respect the one assigned to executingThread
instance.- Parameters:
runnable
- Runnable future to guard.uncaughtExceptionHandler
- Handler to call in case of uncaught exception.- Returns:
- Future with handler.
-
-