com.sleepycat.je.txn
Class LatchedLockManager

java.lang.Object
  extended by com.sleepycat.je.txn.LockManager
      extended by com.sleepycat.je.txn.LatchedLockManager
All Implemented Interfaces:
EnvConfigObserver

public class LatchedLockManager
extends LockManager

LatchedLockManager uses latches to implement its critical sections.


Field Summary
 
Fields inherited from class com.sleepycat.je.txn.LockManager
lockTableLatches, nLockTables
 
Constructor Summary
LatchedLockManager(EnvironmentImpl envImpl)
           
 
Method Summary
protected  com.sleepycat.je.txn.LockAttemptResult attemptLock(java.lang.Long nodeId, Locker locker, LockType type, boolean nonBlockingRequest)
           
protected  void dumpLockTable(LockStats stats)
          Dump the lock table to the lock stats.
protected  com.sleepycat.je.txn.Lock lookupLock(java.lang.Long nodeId)
           
protected  DeadlockException makeTimeoutMsg(java.lang.String lockOrTxn, Locker locker, long nodeId, LockType type, LockGrantType grantType, com.sleepycat.je.txn.Lock useLock, long timeout, long start, long now, DatabaseImpl database)
          Create a informative lock or txn timeout message.
protected  java.util.Set<Locker> releaseAndFindNotifyTargets(long nodeId, Locker locker)
          Release the lock, and return the set of new owners to notify, if any.
protected  boolean validateOwnership(java.lang.Long nodeId, Locker locker, LockType type, boolean flushFromWaiters, MemoryBudget mb)
           
 
Methods inherited from class com.sleepycat.je.txn.LockManager
attemptLockInternal, demoteInternal, dump, dumpLockTableInternal, dumpToString, envConfigUpdate, getLockTableIndex, getLockTableIndex, getWriteOwnerLockerInternal, isLockedInternal, isOwnerInternal, isWaiterInternal, lock, lockStat, lookupLockInternal, makeTimeoutMsgInternal, nOwnersInternal, nWaitersInternal, 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

LatchedLockManager

public LatchedLockManager(EnvironmentImpl envImpl)
                   throws DatabaseException
Throws:
DatabaseException
Method Detail

lookupLock

protected com.sleepycat.je.txn.Lock lookupLock(java.lang.Long nodeId)
                                        throws DatabaseException
Specified by:
lookupLock in class LockManager
Throws:
DatabaseException
See Also:
LockManager.lookupLock(java.lang.Long)

attemptLock

protected com.sleepycat.je.txn.LockAttemptResult attemptLock(java.lang.Long nodeId,
                                                             Locker locker,
                                                             LockType type,
                                                             boolean nonBlockingRequest)
                                                      throws DatabaseException
Specified by:
attemptLock in class LockManager
Throws:
DatabaseException
See Also:
LockManager.attemptLock(java.lang.Long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.LockType, boolean)

makeTimeoutMsg

protected DeadlockException makeTimeoutMsg(java.lang.String lockOrTxn,
                                           Locker locker,
                                           long nodeId,
                                           LockType type,
                                           LockGrantType grantType,
                                           com.sleepycat.je.txn.Lock useLock,
                                           long timeout,
                                           long start,
                                           long now,
                                           DatabaseImpl database)
                                    throws DatabaseException
Description copied from class: LockManager
Create a informative lock or txn timeout message.

Specified by:
makeTimeoutMsg in class LockManager
Throws:
DatabaseException
See Also:
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)

releaseAndFindNotifyTargets

protected java.util.Set<Locker> releaseAndFindNotifyTargets(long nodeId,
                                                            Locker locker)
                                                     throws DatabaseException
Description copied from class: LockManager
Release the lock, and return the set of new owners to notify, if any.

Specified by:
releaseAndFindNotifyTargets in class LockManager
Returns:
null if the lock does not exist or the given locker was not the owner, a non-empty set if owners should be notified after releasing, an empty set if no notification is required.
Throws:
DatabaseException
See Also:
LockManager#releaseAndNotifyTargets

validateOwnership

protected boolean validateOwnership(java.lang.Long nodeId,
                                    Locker locker,
                                    LockType type,
                                    boolean flushFromWaiters,
                                    MemoryBudget mb)
                             throws DatabaseException
Specified by:
validateOwnership in class LockManager
Throws:
DatabaseException
See Also:
LockManager.validateOwnership(java.lang.Long, com.sleepycat.je.txn.Locker, com.sleepycat.je.txn.LockType, boolean, com.sleepycat.je.dbi.MemoryBudget)

dumpLockTable

protected void dumpLockTable(LockStats stats)
                      throws DatabaseException
Description copied from class: LockManager
Dump the lock table to the lock stats.

Specified by:
dumpLockTable in class LockManager
Throws:
DatabaseException
See Also:
LockManager.dumpLockTable(com.sleepycat.je.LockStats)