|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.txn.LockManager
com.sleepycat.je.txn.SyncedLockManager
public class SyncedLockManager
SyncedLockManager uses the synchronized keyword to implement its critical sections.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sleepycat.je.txn.LockManager |
---|
LockManager.LockAttemptResult |
Field Summary |
---|
Fields inherited from class com.sleepycat.je.txn.LockManager |
---|
lockTableLatch, TOTAL_LOCK_OVERHEAD |
Constructor Summary | |
---|---|
SyncedLockManager(EnvironmentImpl envImpl)
|
Method Summary | |
---|---|
protected LockManager.LockAttemptResult |
attemptLock(Long nodeId,
Locker locker,
LockType type,
boolean nonBlockingRequest)
|
(package private) void |
demote(long nodeId,
Locker locker)
Demote a lock from write to read. |
protected void |
dumpLockTable(LockStats stats)
Dump the lock table to the lock stats. |
(package private) Locker |
getWriteOwnerLocker(Long nodeId)
|
(package private) boolean |
isLocked(Long nodeId)
Test the status of the lock on nodeId. |
(package private) boolean |
isOwner(Long nodeId,
Locker locker,
LockType type)
Return true if this locker owns this a lock of this type on given node. |
(package private) boolean |
isWaiter(Long nodeId,
Locker locker)
Return true if this locker is waiting on this lock. |
protected String |
makeTimeoutMsg(String lockOrTxn,
Locker locker,
long nodeId,
LockType type,
LockGrantType grantType,
Lock useLock,
long timeout,
long start,
long now,
DatabaseImpl database)
Create a informative lock or txn timeout message. |
(package private) int |
nOwners(Long nodeId)
Return the number of owners of this lock. |
(package private) int |
nWaiters(Long nodeId)
Return the number of waiters for this lock. |
protected Set |
releaseAndFindNotifyTargets(long nodeId,
Lock lock,
Locker locker,
boolean removeFromLocker)
Release the lock, and return the set of new owners to notify, if any. |
(package private) void |
transfer(long nodeId,
Locker owningLocker,
Locker destLocker,
boolean demoteToRead)
Transfer ownership a lock from one locker to another locker. |
(package private) void |
transferMultiple(long nodeId,
Locker owningLocker,
Locker[] destLockers)
Transfer ownership a lock from one locker to a set of other txns, cloning the lock as necessary. |
protected boolean |
validateOwnership(Long nodeId,
Locker locker,
LockType type,
boolean flushFromWaiters,
MemoryBudget mb)
|
Methods inherited from class com.sleepycat.je.txn.LockManager |
---|
attemptLockInternal, demoteInternal, dump, dumpLockTableInternal, dumpToString, getWriteOwnerLockerInternal, isLockedInternal, isOwnerInternal, isWaiterInternal, lock, lockStat, makeTimeoutMsgInternal, nOwnersInternal, nWaitersInternal, release, release, releaseAndFindNotifyTargetsInternal, transferInternal, transferMultipleInternal, validateOwnershipInternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyncedLockManager(EnvironmentImpl envImpl) throws DatabaseException
DatabaseException
Method Detail |
---|
protected LockManager.LockAttemptResult attemptLock(Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest) throws DatabaseException
attemptLock
in class LockManager
DatabaseException
LockManager.attemptLock(java.lang.Long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.LockType, boolean)
protected String makeTimeoutMsg(String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, Lock useLock, long timeout, long start, long now, DatabaseImpl database)
LockManager
makeTimeoutMsg
in class LockManager
LockManager.makeTimeoutMsg(java.lang.String, com.sleepycat.je.txn.Locker, long, com.sleepycat.je.txn.LockType, com.sleepycat.je.txn.LockGrantType, com.sleepycat.je.txn.Lock, long, long, long, com.sleepycat.je.dbi.DatabaseImpl)
protected Set releaseAndFindNotifyTargets(long nodeId, Lock lock, Locker locker, boolean removeFromLocker) throws DatabaseException
LockManager
releaseAndFindNotifyTargets
in class LockManager
DatabaseException
LockManager#releaseAndNotifyTargets
void transfer(long nodeId, Locker owningLocker, Locker destLocker, boolean demoteToRead) throws DatabaseException
LockManager
transfer
in class LockManager
DatabaseException
LockManager.transfer(long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.Locker, boolean)
void transferMultiple(long nodeId, Locker owningLocker, Locker[] destLockers) throws DatabaseException
LockManager
transferMultiple
in class LockManager
DatabaseException
LockManager.transferMultiple(long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.Locker[])
void demote(long nodeId, Locker locker) throws DatabaseException
LockManager
demote
in class LockManager
DatabaseException
LockManager.demote(long, com.sleepycat.je.txn.Locker)
boolean isLocked(Long nodeId)
LockManager
isLocked
in class LockManager
nodeId
- The NodeId to check.
LockManager.isLocked(java.lang.Long)
boolean isOwner(Long nodeId, Locker locker, LockType type)
LockManager
isOwner
in class LockManager
LockManager.isOwner(java.lang.Long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.LockType)
boolean isWaiter(Long nodeId, Locker locker)
LockManager
isWaiter
in class LockManager
LockManager.isWaiter(java.lang.Long, com.sleepycat.je.txn.Locker)
int nWaiters(Long nodeId)
LockManager
nWaiters
in class LockManager
LockManager.nWaiters(java.lang.Long)
int nOwners(Long nodeId)
LockManager
nOwners
in class LockManager
LockManager.nOwners(java.lang.Long)
Locker getWriteOwnerLocker(Long nodeId) throws DatabaseException
getWriteOwnerLocker
in class LockManager
DatabaseException
LockManager#getWriterOwnerLocker
protected boolean validateOwnership(Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb) throws DatabaseException
validateOwnership
in class LockManager
DatabaseException
LockManager.validateOwnership(java.lang.Long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.LockType, boolean, com.sleepycat.je.dbi.MemoryBudget)
protected void dumpLockTable(LockStats stats) throws DatabaseException
LockManager
dumpLockTable
in class LockManager
DatabaseException
LockManager.dumpLockTable(com.sleepycat.je.LockStats)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |