public class BasicLocker extends Locker
afterWaiterHook, envImpl, id, lockManager, thread| Modifier | Constructor and Description |
|---|---|
protected |
BasicLocker(EnvironmentImpl env)
Creates a BasicLocker.
|
protected |
BasicLocker(EnvironmentImpl env,
boolean noWait)
Creates a BasicLocker with a noWait argument.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDbCleanup(DbCleanup cleanup)
Database operations like remove, truncate and rename require that
DatabaseImpls are deleted or updated at transaction commit or abort.
|
protected void |
addLock(Long lsn,
LockType type,
LockGrantType grantStatus)
Add a lock to set owned by this transaction.
|
protected void |
checkState(boolean ignoreCalledByAbort) |
StatGroup |
collectStats()
Stats.
|
static BasicLocker |
createBasicLocker(EnvironmentImpl env) |
static BasicLocker |
createBasicLocker(EnvironmentImpl env,
boolean noWait) |
protected long |
generateId(TxnManager txnManager,
long ignore)
BasicLockers always have a fixed id, because they are never used for
recovery.
|
Txn |
getTxnLocker()
No transactional locker is available.
|
WriteLockInfo |
getWriteLockInfo(long lsn) |
Locker |
getWriteOwnerLocker(long lsn)
Get the txn that owns the lock on this node.
|
boolean |
isReadCommittedIsolation()
Is never read-committed isolation.
|
boolean |
isSerializableIsolation()
Is never serializable isolation.
|
boolean |
isTransactional()
Is never transactional.
|
boolean |
lockingRequired()
Returns true if locking is required for this Locker.
|
protected LockResult |
lockInternal(long lsn,
LockType lockType,
boolean noWait,
boolean jumpAheadOfWaiters,
DatabaseImpl database)
Abstract method to a blocking or non-blocking lock of the given type on
the given LSN.
|
Locker |
newNonTxnLocker()
Throws EnvironmentFailureException unconditionally.
|
void |
nonTxnOperationEnd()
Release locks and close the cursor at the end of the operation.
|
void |
operationEnd(boolean operationOK)
Release locks and close the cursor at the end of the operation.
|
void |
preLogWithoutLock(DatabaseImpl database)
In the case where logging occurs before locking, allow lockers to reject
the operation (e.g., if writing on a replica) and also prepare to undo
in the (very unlikely) event that logging succeeds but locking fails.
|
void |
registerCursor(CursorImpl cursor)
This txn doesn't store cursors.
|
void |
releaseNonTxnLocks()
Releases all locks, since all locks held by this locker are
non-transactional.
|
void |
unRegisterCursor(CursorImpl cursor)
This txn doesn't store cursors.
|
addDeleteInfo, addOpenedDatabase, allowReleaseLockAfterLsnChange, checkPreempted, demoteLock, disallowReplicaWrite, dumpLockTable, getDefaultNoWait, getEnvironment, getId, getImportunate, getInitialLockTimeout, getLockTimeout, getPreemptable, getTransaction, getTxnTimeout, isLocalWrite, isReadOnly, isReadUncommittedDefault, isReplicated, isRolledBack, isTimedOut, isValid, lock, lockAfterLsnChange, nonBlockingLock, openCursorHook, operationEnd, operationEnd, releaseLock, setClosingLocker, setDefaultNoWait, setImportunate, setLockTimeout, setOnlyAbortable, setPreemptable, setPreempted, setTxnTimeout, sharesLocksWith, toStringprotected BasicLocker(EnvironmentImpl env)
protected BasicLocker(EnvironmentImpl env, boolean noWait)
public static BasicLocker createBasicLocker(EnvironmentImpl env) throws DatabaseException
DatabaseExceptionpublic static BasicLocker createBasicLocker(EnvironmentImpl env, boolean noWait) throws DatabaseException
DatabaseExceptionprotected long generateId(TxnManager txnManager, long ignore)
generateId in class Lockerprotected void checkState(boolean ignoreCalledByAbort)
checkState in class Lockerprotected LockResult lockInternal(long lsn, LockType lockType, boolean noWait, boolean jumpAheadOfWaiters, DatabaseImpl database) throws DatabaseException
Lockerlsn - is the node to lock.lockType - is the type of lock to request.noWait - is true to override the defaultNoWait setting. If true,
or if defaultNoWait is true, throws LockNotAvailableException if the
lock cannot be granted without waiting.jumpAheadOfWaiters - grant the lock before other waiters, if any.database - is the database containing lsn.LockConflictException - if a blocking lock could not be acquired.DatabaseExceptionpublic void preLogWithoutLock(DatabaseImpl database)
LockerpreLogWithoutLock in class Lockerpublic Locker getWriteOwnerLocker(long lsn) throws DatabaseException
DatabaseExceptionpublic boolean isTransactional()
isTransactional in class Lockerpublic boolean isSerializableIsolation()
isSerializableIsolation in class Lockerpublic boolean isReadCommittedIsolation()
isReadCommittedIsolation in class Lockerpublic Txn getTxnLocker()
getTxnLocker in class Lockerpublic Locker newNonTxnLocker() throws DatabaseException
newNonTxnLocker in class LockerDatabaseException - from subclasses.public void releaseNonTxnLocks()
throws DatabaseException
releaseNonTxnLocks in class LockerDatabaseExceptionpublic void nonTxnOperationEnd()
throws DatabaseException
nonTxnOperationEnd in class LockerDatabaseExceptionpublic void operationEnd(boolean operationOK)
throws DatabaseException
operationEnd in class LockeroperationOK - is whether the operation succeeded, since
that may impact ending behavior. (i.e for an auto Txn)DatabaseExceptionpublic void registerCursor(CursorImpl cursor)
registerCursor in class LockerDatabaseException - in subclasses.public void unRegisterCursor(CursorImpl cursor)
unRegisterCursor in class Lockerpublic boolean lockingRequired()
LockerlockingRequired in class Lockerpublic WriteLockInfo getWriteLockInfo(long lsn)
getWriteLockInfo in class Lockerpublic void addDbCleanup(DbCleanup cleanup)
LockeraddDbCleanup in class Lockerprotected void addLock(Long lsn, LockType type, LockGrantType grantStatus)
public StatGroup collectStats() throws DatabaseException
collectStats in class LockerDatabaseExceptionCopyright © 2024. All rights reserved.