Class VeniceReentrantReadWriteLock
- java.lang.Object
-
- java.util.concurrent.locks.ReentrantReadWriteLock
-
- com.linkedin.venice.utils.concurrent.VeniceReentrantReadWriteLock
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.locks.ReadWriteLock
public class VeniceReentrantReadWriteLock extends java.util.concurrent.locks.ReentrantReadWriteLock
This class simply exposes publicly the protected methods of its parent, for debugging purposes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VeniceReentrantReadWriteLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Thread
getOwner()
Returns the thread that currently owns the write lock, ornull
if not owned.java.util.Collection<java.lang.Thread>
getQueuedReaderThreads()
Returns a collection containing threads that may be waiting to acquire the read lock.java.util.Collection<java.lang.Thread>
getQueuedThreads()
Returns a collection containing threads that may be waiting to acquire either the read or write lock.java.util.Collection<java.lang.Thread>
getQueuedWriterThreads()
Returns a collection containing threads that may be waiting to acquire the write lock.java.util.Collection<java.lang.Thread>
getWaitingThreads(java.util.concurrent.locks.Condition condition)
Returns a collection containing those threads that may be waiting on the given condition associated with the write lock.java.lang.String
toString()
-
-
-
Method Detail
-
getOwner
public java.lang.Thread 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 classjava.util.concurrent.locks.ReentrantReadWriteLock
- Returns:
- the owner, or
null
if not owned
-
getQueuedWriterThreads
public java.util.Collection<java.lang.Thread> 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 classjava.util.concurrent.locks.ReentrantReadWriteLock
- Returns:
- the collection of threads
-
getQueuedReaderThreads
public java.util.Collection<java.lang.Thread> 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 classjava.util.concurrent.locks.ReentrantReadWriteLock
- Returns:
- the collection of threads
-
getQueuedThreads
public java.util.Collection<java.lang.Thread> 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 classjava.util.concurrent.locks.ReentrantReadWriteLock
- Returns:
- the collection of threads
-
getWaitingThreads
public java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition condition)
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 classjava.util.concurrent.locks.ReentrantReadWriteLock
- Parameters:
condition
- the condition- Returns:
- the collection of threads
- Throws:
java.lang.IllegalMonitorStateException
- if this lock is not heldjava.lang.IllegalArgumentException
- if the given condition is not associated with this lockjava.lang.NullPointerException
- if the condition is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.concurrent.locks.ReentrantReadWriteLock
-
-