Class VeniceReentrantReadWriteLock
java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock
com.linkedin.venice.utils.concurrent.VeniceReentrantReadWriteLock
- All Implemented Interfaces:
Serializable
,ReadWriteLock
This class simply exposes publicly the protected methods of its parent, for debugging purposes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
ReentrantReadWriteLock.ReadLock, ReentrantReadWriteLock.WriteLock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetOwner()
Returns the thread that currently owns the write lock, ornull
if not owned.Returns a collection containing threads that may be waiting to acquire the read lock.Returns a collection containing threads that may be waiting to acquire either the read or write lock.Returns a collection containing threads that may be waiting to acquire the write lock.getWaitingThreads
(Condition condition) Returns a collection containing those threads that may be waiting on the given condition associated with the write lock.toString()
Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
getQueueLength, getReadHoldCount, getReadLockCount, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, writeLock
-
Constructor Details
-
VeniceReentrantReadWriteLock
public VeniceReentrantReadWriteLock()
-
-
Method Details
-
getOwner
Returns the thread that currently owns the write lock, ornull
if not owned. When this method is called by a thread that is not the owner, the return value reflects a best-effort approximation of current lock status. For example, the owner may be momentarilynull
even if there are threads trying to acquire the lock but have not yet done so. This method is designed to facilitate construction of subclasses that provide more extensive lock monitoring facilities.- Overrides:
getOwner
in classReentrantReadWriteLock
- Returns:
- the owner, or
null
if not owned
-
getQueuedWriterThreads
Returns a collection containing threads that may be waiting to acquire the write lock. Because the actual set of threads may change dynamically while constructing this result, the returned collection is only a best-effort estimate. The elements of the returned collection are in no particular order. This method is designed to facilitate construction of subclasses that provide more extensive lock monitoring facilities.- Overrides:
getQueuedWriterThreads
in classReentrantReadWriteLock
- Returns:
- the collection of threads
-
getQueuedReaderThreads
Returns a collection containing threads that may be waiting to acquire the read lock. Because the actual set of threads may change dynamically while constructing this result, the returned collection is only a best-effort estimate. The elements of the returned collection are in no particular order. This method is designed to facilitate construction of subclasses that provide more extensive lock monitoring facilities.- Overrides:
getQueuedReaderThreads
in classReentrantReadWriteLock
- Returns:
- the collection of threads
-
getQueuedThreads
Returns a collection containing threads that may be waiting to acquire either the read or write lock. Because the actual set of threads may change dynamically while constructing this result, the returned collection is only a best-effort estimate. The elements of the returned collection are in no particular order. This method is designed to facilitate construction of subclasses that provide more extensive monitoring facilities.- Overrides:
getQueuedThreads
in classReentrantReadWriteLock
- Returns:
- the collection of threads
-
getWaitingThreads
Returns a collection containing those threads that may be waiting on the given condition associated with the write lock. Because the actual set of threads may change dynamically while constructing this result, the returned collection is only a best-effort estimate. The elements of the returned collection are in no particular order. This method is designed to facilitate construction of subclasses that provide more extensive condition monitoring facilities.- Overrides:
getWaitingThreads
in classReentrantReadWriteLock
- Parameters:
condition
- the condition- Returns:
- the collection of threads
- Throws:
IllegalMonitorStateException
- if this lock is not heldIllegalArgumentException
- if the given condition is not associated with this lockNullPointerException
- if the condition is null
-
toString
- Overrides:
toString
in classReentrantReadWriteLock
-