Package org.apache.flink.runtime.util
Class Runnables
java.lang.Object
org.apache.flink.runtime.util.Runnables
Utils related to
Runnable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
Runnables
public Runnables()
-
-
Method Details
-
assertNoException
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.
-