Package com.linkedin.venice.utils.locks
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 java.lang.Object
This class maintains a map from resource of a certain type to its lock. Its purpose is to support fine granular locking
-
-
Constructor Summary
Constructors Constructor Description ResourceAutoClosableLockManager(java.util.function.Supplier<java.util.concurrent.locks.Lock> lockCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoCloseableLock
getLockForResource(T resource)
void
removeAllLocks()
void
removeLockForResource(T resource)
-
-
-
Method Detail
-
getLockForResource
public AutoCloseableLock getLockForResource(@Nonnull T resource)
-
removeLockForResource
public void removeLockForResource(@Nonnull T resource)
-
removeAllLocks
public void removeAllLocks()
-
-