| java.lang.Object com.sleepycat.je.txn.Lock
Lock | public class Lock (Code) | | A Lock embodies the lock state of a NodeId. It includes a set of owners and
a list of waiters.
|
Constructor Summary | |
public | Lock() Create a Lock. |
Method Summary | |
void | demote(Locker locker) Downgrade a write lock to a read lock. | void | flushWaiter(Locker locker, MemoryBudget mb, int lockTableIndex) Remove this locker from the waiter list. | Set | getOwnersClone() Get a new Set of the owners. | List | getWaitersListClone() Get a list of waiters for debugging and error messages. | Locker | getWriteOwnerLocker() Return the locker that has a write ownership on this lock. | boolean | isOwnedWriteLock(Locker locker) Return true if locker is an owner of this Lock and this is a write
lock. | boolean | isOwner(Locker locker, LockType lockType) Return true if locker is an owner of this Lock for lockType,
false otherwise. | boolean | isWaiter(Locker locker) Return true if locker is a waiter on this Lock. | LockGrantType | lock(LockType requestType, Locker locker, boolean nonBlockingRequest, MemoryBudget mb, int lockTableIndex) Attempts to acquire the lock and returns the LockGrantType. | int | nOwners() | int | nWaiters() | Set | release(Locker locker, MemoryBudget mb, int lockTableIndex) Releases a lock and moves the next waiter(s) to the owners. | public String | toString() Debug dumper. | LockType | transfer(Long nodeId, Locker currentLocker, Locker destLocker, MemoryBudget mb, int lockTableIndex) Transfer a lock from one transaction to another. | LockType | transferMultiple(Long nodeId, Locker currentLocker, Locker[] destLockers, MemoryBudget mb, int lockTableIndex) Transfer a lock from one transaction to many others. |
Lock | public Lock()(Code) | | Create a Lock. public for Sizeof
|
demote | void demote(Locker locker)(Code) | | Downgrade a write lock to a read lock.
|
flushWaiter | void flushWaiter(Locker locker, MemoryBudget mb, int lockTableIndex)(Code) | | Remove this locker from the waiter list.
|
getOwnersClone | Set getOwnersClone()(Code) | | Get a new Set of the owners.
|
getWaitersListClone | List getWaitersListClone()(Code) | | Get a list of waiters for debugging and error messages.
|
getWriteOwnerLocker | Locker getWriteOwnerLocker()(Code) | | Return the locker that has a write ownership on this lock. If no
write owner exists, return null.
|
isOwnedWriteLock | boolean isOwnedWriteLock(Locker locker)(Code) | | Return true if locker is an owner of this Lock and this is a write
lock.
|
isOwner | boolean isOwner(Locker locker, LockType lockType)(Code) | | Return true if locker is an owner of this Lock for lockType,
false otherwise.
This method is only used by unit tests.
|
isWaiter | boolean isWaiter(Locker locker)(Code) | | Return true if locker is a waiter on this Lock.
This method is only used by unit tests.
|
lock | LockGrantType lock(LockType requestType, Locker locker, boolean nonBlockingRequest, MemoryBudget mb, int lockTableIndex)(Code) | | Attempts to acquire the lock and returns the LockGrantType.
Assumes we hold the lockTableLatch when entering this method.
|
release | Set release(Locker locker, MemoryBudget mb, int lockTableIndex)(Code) | | Releases a lock and moves the next waiter(s) to the owners.
null if we were not the owner,a non-empty set if owners should be notified after releasing,an empty set if no notification is required. |
transferMultiple | LockType transferMultiple(Long nodeId, Locker currentLocker, Locker[] destLockers, MemoryBudget mb, int lockTableIndex) throws DatabaseException(Code) | | Transfer a lock from one transaction to many others. Only really needed
for case where a write handle lock is being transferred to multiple read
handles.
|
|
|