|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sleepycat.je.txn.LockImpl
public class LockImpl
A Lock embodies the lock state of a NodeId. It includes a set of owners and a list of waiters.
| Constructor Summary | |
|---|---|
LockImpl()
Create a Lock. |
|
LockImpl(LockInfo firstOwner)
|
|
| 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<LockInfo> |
getOwnersClone()
Get a new Set of the owners. |
List<LockInfo> |
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 |
isThin()
|
boolean |
isWaiter(Locker locker)
Return true if locker is a waiter on this Lock. |
LockAttemptResult |
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<Locker> |
release(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Releases a lock and moves the next waiter(s) to the owners. |
void |
stealLock(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Removes all owners except for the given owner, and sets the Preempted property on the removed owners. |
String |
toString()
Debug dumper. |
Lock |
transfer(Long nodeId,
Locker currentLocker,
Locker destLocker,
MemoryBudget mb,
int lockTableIndex)
Transfer a lock from one transaction to another. |
Lock |
transferMultiple(Long nodeId,
Locker currentLocker,
Locker[] destLockers,
MemoryBudget mb,
int lockTableIndex)
Transfer a lock from one transaction to many others. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LockImpl()
LockImpl(LockInfo firstOwner)
| Method Detail |
|---|
public List<LockInfo> getWaitersListClone()
getWaitersListClone in interface Lock
public void flushWaiter(Locker locker,
MemoryBudget mb,
int lockTableIndex)
flushWaiter in interface Lockpublic Set<LockInfo> getOwnersClone()
getOwnersClone in interface Lock
public boolean isOwner(Locker locker,
LockType lockType)
isOwner in interface Lockpublic boolean isOwnedWriteLock(Locker locker)
isOwnedWriteLock in interface Lockpublic boolean isWaiter(Locker locker)
isWaiter in interface Lockpublic int nWaiters()
nWaiters in interface Lockpublic int nOwners()
nOwners in interface Lock
public LockAttemptResult lock(LockType requestType,
Locker locker,
boolean nonBlockingRequest,
MemoryBudget mb,
int lockTableIndex)
lock in interface Lock
public Set<Locker> release(Locker locker,
MemoryBudget mb,
int lockTableIndex)
release in interface Lock
public void stealLock(Locker locker,
MemoryBudget mb,
int lockTableIndex)
Lock
stealLock in interface Lockpublic void demote(Locker locker)
demote in interface Lock
public Lock transfer(Long nodeId,
Locker currentLocker,
Locker destLocker,
MemoryBudget mb,
int lockTableIndex)
throws DatabaseException
transfer in interface LockDatabaseException
public Lock transferMultiple(Long nodeId,
Locker currentLocker,
Locker[] destLockers,
MemoryBudget mb,
int lockTableIndex)
throws DatabaseException
transferMultiple in interface LockDatabaseExceptionpublic Locker getWriteOwnerLocker()
getWriteOwnerLocker in interface Lockpublic boolean isThin()
isThin in interface Lockpublic String toString()
toString in interface LocktoString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||