com.bigdata.concurrent
Class NonBlockingLockManagerWithNewDesign.ResourceQueue<R extends Comparable<R>,T extends NonBlockingLockManagerWithNewDesign.LockFutureTask<R,? extends Object>>

java.lang.Object
  extended by com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ResourceQueue<R,T>
Type Parameters:
T - The generic type of the elements in the queue.
Enclosing class:
NonBlockingLockManagerWithNewDesign<R extends Comparable<R>>

protected static class NonBlockingLockManagerWithNewDesign.ResourceQueue<R extends Comparable<R>,T extends NonBlockingLockManagerWithNewDesign.LockFutureTask<R,? extends Object>>
extends Object

Unbounded queue of operations waiting to gain an exclusive lock on a resource.

Version:
$Id: NonBlockingLockManagerWithNewDesign.java 5809 2011-12-19 16:56:48Z thompsonbry $
Author:
Bryan Thompson
See Also:
LockManager, TxDag

Constructor Summary
NonBlockingLockManagerWithNewDesign.ResourceQueue(NonBlockingLockManagerWithNewDesign<R> lockService, R resource)
          Create a queue of lock requests for a resource.
 
Method Summary
 int getQueueSize()
          The #of pending requests for a lock on the resource.
 R getResource()
          The resource whose locks are administeded by this object.
 boolean isGranted(T tx)
          Return true if the transaction currently holds the lock.
 boolean isLocked()
          True iff there is a granted group.
 String toString()
          Note: This uses LinkedBlockingQueue.toString() to serialize the state of the resource queue so the result will be consistent per the contract of that method and LinkedBlockingQueue.iterator().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonBlockingLockManagerWithNewDesign.ResourceQueue

public NonBlockingLockManagerWithNewDesign.ResourceQueue(NonBlockingLockManagerWithNewDesign<R> lockService,
                                                         R resource)
Create a queue of lock requests for a resource.

Parameters:
resource - The resource.
Method Detail

getResource

public R getResource()
The resource whose locks are administeded by this object.


isLocked

public boolean isLocked()
True iff there is a granted group.


getQueueSize

public int getQueueSize()
The #of pending requests for a lock on the resource.


isGranted

public boolean isGranted(T tx)
Return true if the transaction currently holds the lock.

Parameters:
tx - The transaction.

toString

public String toString()
Note: This uses LinkedBlockingQueue.toString() to serialize the state of the resource queue so the result will be consistent per the contract of that method and LinkedBlockingQueue.iterator().

Overrides:
toString in class Object


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.