Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.concurrent.locks.ReentrantReadWriteLock

        java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock, java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock
    • 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, or null 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()  
      • Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock

        getQueueLength, getReadHoldCount, getReadLockCount, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, writeLock
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • VeniceReentrantReadWriteLock

        public VeniceReentrantReadWriteLock()
    • Method Detail

      • getOwner

        public java.lang.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 java.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 class java.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 class java.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 class java.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 class java.util.concurrent.locks.ReentrantReadWriteLock
        Parameters:
        condition - the condition
        Returns:
        the collection of threads
        Throws:
        java.lang.IllegalMonitorStateException - if this lock is not held
        java.lang.IllegalArgumentException - if the given condition is not associated with this lock
        java.lang.NullPointerException - if the condition is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.locks.ReentrantReadWriteLock