Class ConcurrencyUtils
java.lang.Object
com.linkedin.venice.utils.concurrent.ConcurrencyUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecuteUnderConditionalLock(Runnable action, BooleanSupplier lockCondition, Object lock) static voidexecuteUnderLock(Runnable action, Runnable orElse, BooleanSupplier lockCondition, Object lock) static <T> TgetOrRethrowCause(Future<T> future, String interruptedMessage) Waits for the future and returns its result.
-
Method Details
-
executeUnderConditionalLock
public static void executeUnderConditionalLock(Runnable action, BooleanSupplier lockCondition, Object lock) -
executeUnderLock
public static void executeUnderLock(Runnable action, Runnable orElse, BooleanSupplier lockCondition, Object lock) -
getOrRethrowCause
Waits for the future and returns its result. A failure of the task is rethrown as if the task had run on this thread: aRuntimeExceptionor anErroras is, any other exception wrapped in aVeniceException. If this thread is interrupted while waiting, its interrupt status is kept and aVeniceExceptionwith the given message is thrown.
-