Class VeniceReentrantReadWriteLock

java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock
com.linkedin.venice.utils.concurrent.VeniceReentrantReadWriteLock
All Implemented Interfaces:
Serializable, ReadWriteLock

public class VeniceReentrantReadWriteLock extends ReentrantReadWriteLock
This class simply exposes publicly the protected methods of its parent, for debugging purposes.
See Also:
  • Constructor Details

    • VeniceReentrantReadWriteLock

      public VeniceReentrantReadWriteLock()
  • Method Details

    • getOwner

      public Thread getOwner()
      Returns the thread that currently owns the write lock, or null 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 momentarily null 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 class ReentrantReadWriteLock
      Returns:
      the owner, or null if not owned
    • getQueuedWriterThreads

      public Collection<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 class ReentrantReadWriteLock
      Returns:
      the collection of threads
    • getQueuedReaderThreads

      public Collection<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 class ReentrantReadWriteLock
      Returns:
      the collection of threads
    • getQueuedThreads

      public Collection<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 class ReentrantReadWriteLock
      Returns:
      the collection of threads
    • getWaitingThreads

      public Collection<Thread> getWaitingThreads(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 class ReentrantReadWriteLock
      Parameters:
      condition - the condition
      Returns:
      the collection of threads
      Throws:
      IllegalMonitorStateException - if this lock is not held
      IllegalArgumentException - if the given condition is not associated with this lock
      NullPointerException - if the condition is null
    • toString

      public String toString()
      Overrides:
      toString in class ReentrantReadWriteLock