Package com.linkedin.venice.utils.locks
Class ClusterLockManager
- java.lang.Object
-
- com.linkedin.venice.utils.locks.ClusterLockManager
-
public class ClusterLockManager extends java.lang.Object
A centralized place to control the locking behavior, such as lock order and lock granularity. There is 1-1 mapping between ClusterLockManager instances and clusters. One instance only manages locks for one cluster. Each instance has a pair of cluster-level read/write locks and multiple store-level read/write locks. Every store-level read/write lock will take cluster-level read lock first. Locking on the whole cluster, including whole cluster write operations or controller shutdown, will take the cluster-level write lock.
-
-
Constructor Summary
Constructors Constructor Description ClusterLockManager(java.lang.String clusterName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
AutoCloseableLock
createClusterReadLock()
AutoCloseableLock
createClusterWriteLock()
AutoCloseableLock
createStoreReadLock(java.lang.String storeName)
AutoCloseableLock
createStoreWriteLock(java.lang.String storeName)
AutoCloseableLock
createStoreWriteLockOnly(java.lang.String storeName)
-
-
-
Method Detail
-
createClusterWriteLock
public AutoCloseableLock createClusterWriteLock()
-
createClusterReadLock
public AutoCloseableLock createClusterReadLock()
-
createStoreReadLock
public AutoCloseableLock createStoreReadLock(java.lang.String storeName)
-
createStoreWriteLock
public AutoCloseableLock createStoreWriteLock(java.lang.String storeName)
-
createStoreWriteLockOnly
public AutoCloseableLock createStoreWriteLockOnly(java.lang.String storeName)
-
clear
public void clear()
-
-