Class ResourceAutoClosableLockManager<T>

java.lang.Object
com.linkedin.venice.utils.locks.ResourceAutoClosableLockManager<T>
Type Parameters:
T - Type of the resource

public class ResourceAutoClosableLockManager<T> extends Object
This class maintains a map from resource of a certain type to its lock. Its purpose is to support fine granular locking
  • Constructor Details

    • ResourceAutoClosableLockManager

      public ResourceAutoClosableLockManager(@Nonnull Supplier<Lock> lockCreator)
  • Method Details

    • getLockForResource

      public AutoCloseableLock getLockForResource(@Nonnull T resource)
    • removeLockForResource

      public void removeLockForResource(@Nonnull T resource)
    • removeAllLocks

      public void removeAllLocks()