Class ConcurrencyUtils

java.lang.Object
com.linkedin.venice.utils.concurrent.ConcurrencyUtils

public final class ConcurrencyUtils extends Object
  • 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

      public static <T> T getOrRethrowCause(Future<T> future, String interruptedMessage)
      Waits for the future and returns its result. A failure of the task is rethrown as if the task had run on this thread: a RuntimeException or an Error as is, any other exception wrapped in a VeniceException. If this thread is interrupted while waiting, its interrupt status is kept and a VeniceException with the given message is thrown.