public abstract class LockManager extends Object implements EnvConfigObserver
| Modifier and Type | Field and Description |
|---|---|
static TestHook<Void> |
afterLockHook |
| Constructor and Description |
|---|
LockManager(EnvironmentImpl envImpl) |
| Modifier and Type | Method and Description |
|---|---|
void |
dump()
Debugging
|
void |
envConfigUpdate(DbConfigManager configMgr,
EnvironmentMutableConfig ignore)
Process notifications of mutable property changes.
|
abstract LockType |
getOwnedLockType(Long lsn,
Locker locker)
Returns the LockType if the given locker owns a lock on the given node,
or null if the lock is not owned.
|
abstract Set<LockInfo> |
getOwners(Long lsn)
Returns the Lockers that own a lock on the given LSN.
|
abstract List<LockInfo> |
getWaiters(Long lsn)
Returns the Lockers that wait on a lock on the given LSN.
|
abstract Locker |
getWriteOwnerLocker(Long lsn) |
abstract boolean |
isLockUncontended(Long lsn) |
StatGroup |
loadStats(StatsConfig config) |
LockGrantType |
lock(long lsn,
Locker locker,
LockType type,
long timeout,
boolean nonBlockingRequest,
boolean jumpAheadOfWaiters,
DatabaseImpl database)
Attempt to acquire a lock of 'type' on 'lsn'.
|
abstract boolean |
ownsOrSharesLock(Locker locker,
Long lsn) |
boolean |
release(long lsn,
Locker locker)
Release a lock and possibly notify any waiters that they have been
granted the lock.
|
abstract LockAttemptResult |
stealLock(Long lsn,
Locker locker,
LockType lockType) |
public LockManager(EnvironmentImpl envImpl)
public void envConfigUpdate(DbConfigManager configMgr, EnvironmentMutableConfig ignore)
envConfigUpdate in interface EnvConfigObserverpublic LockGrantType lock(long lsn, Locker locker, LockType type, long timeout, boolean nonBlockingRequest, boolean jumpAheadOfWaiters, DatabaseImpl database) throws DatabaseException
lsn - The LSN to lock.locker - The Locker to lock this on behalf of.type - The lock type requested.timeout - milliseconds to time out after if lock couldn't be
obtained. 0 means block indefinitely. Not used if nonBlockingRequest
is true.nonBlockingRequest - if true, means don't block if lock can't be
acquired, and ignore the timeout parameter.jumpAheadOfWaiters - grant the lock before other waiters, if any.LockConflictException - if lock could not be acquired. If
nonBlockingRequest is true, a LockConflictException is never thrown.
Otherwise, if the lock acquisition would result in a deadlock,
DeadlockException is thrown. Otherwise, if the lock timeout interval
elapses and no deadlock is detected, LockTimeoutException is thrown.DatabaseExceptionpublic abstract Set<LockInfo> getOwners(Long lsn)
public abstract List<LockInfo> getWaiters(Long lsn)
public abstract LockType getOwnedLockType(Long lsn, Locker locker)
public abstract boolean isLockUncontended(Long lsn)
public boolean release(long lsn,
Locker locker)
throws DatabaseException
lsn - The LSN of the lock to release.DatabaseExceptionpublic abstract Locker getWriteOwnerLocker(Long lsn) throws DatabaseException
DatabaseExceptionpublic abstract LockAttemptResult stealLock(Long lsn, Locker locker, LockType lockType) throws DatabaseException
DatabaseExceptionpublic StatGroup loadStats(StatsConfig config)
public void dump()
throws DatabaseException
DatabaseExceptionCopyright © 2024. All rights reserved.