|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sleepycat.je.txn.Locker
com.sleepycat.je.txn.BasicLocker
public class BasicLocker
A non-transactional Locker that simply tracks locks and releases them when releaseNonTxnLocks or operationEnd is called.
| Field Summary |
|---|
| Fields inherited from class com.sleepycat.je.txn.Locker |
|---|
defaultNoWait, deleteInfo, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, readUncommittedDefault, thread |
| Constructor Summary | |
|---|---|
protected |
BasicLocker(EnvironmentImpl env)
Creates a BasicLocker. |
protected |
BasicLocker(EnvironmentImpl env,
boolean noWait)
Creates a BasicLocker with a noWait argument. |
| Method Summary | |
|---|---|
protected void |
addLock(Long nodeId,
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)
|
boolean |
createdNode(long nodeId)
Always false for this txn. |
protected long |
generateId(TxnManager txnManager,
long ignore)
BasicLockers always have a fixed id, because they are never used for recovery. |
long |
getAbortLsn(long nodeId)
|
Txn |
getTxnLocker()
No transactional locker is available. |
WriteLockInfo |
getWriteLockInfo(long nodeId)
|
Locker |
getWriteOwnerLocker(long nodeId)
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 nodeId,
LockType lockType,
boolean noWait,
DatabaseImpl database)
Abstract method to a blocking or non-blocking lock of the given type on the given nodeId. |
void |
markDeleteAtTxnEnd(DatabaseImpl db,
boolean deleteAtCommit)
Database operations like remove and truncate leave behind residual DatabaseImpls that must be purged at transaction commit or abort. |
(package private) void |
moveWriteToReadLock(long nodeId,
Lock lock)
A lock is being demoted. |
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 |
registerCursor(CursorImpl cursor)
This txn doesn't store cursors. |
void |
releaseNonTxnLocks()
Releases all locks, since all locks held by this locker are non-transactional. |
(package private) void |
removeLock(long nodeId)
Remove a lock from the set owned by this txn. |
void |
setHandleLockOwner(boolean operationOK,
Database dbHandle,
boolean dbIsClosing)
Transfer any MapLN locks to the db handle. |
void |
unRegisterCursor(CursorImpl cursor)
This txn doesn't store cursors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BasicLocker(EnvironmentImpl env)
protected BasicLocker(EnvironmentImpl env,
boolean noWait)
| Method Detail |
|---|
public static BasicLocker createBasicLocker(EnvironmentImpl env)
throws DatabaseException
DatabaseException
public static BasicLocker createBasicLocker(EnvironmentImpl env,
boolean noWait)
throws DatabaseException
DatabaseException
protected long generateId(TxnManager txnManager,
long ignore)
generateId in class Lockerprotected void checkState(boolean ignoreCalledByAbort)
checkState in class Locker
protected LockResult lockInternal(long nodeId,
LockType lockType,
boolean noWait,
DatabaseImpl database)
throws DatabaseException
Locker
lockInternal in class LockernodeId - 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.database - is the database containing nodeId.
LockConflictException - if a blocking lock could not be acquired.
DatabaseException
public Locker getWriteOwnerLocker(long nodeId)
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 Locker
public Locker newNonTxnLocker()
throws DatabaseException
newNonTxnLocker in class LockerDatabaseException - from subclasses.
public void releaseNonTxnLocks()
throws DatabaseException
releaseNonTxnLocks in class LockerDatabaseException
public void nonTxnOperationEnd()
throws DatabaseException
nonTxnOperationEnd in class LockerDatabaseException
public 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)
DatabaseException
public void setHandleLockOwner(boolean operationOK,
Database dbHandle,
boolean dbIsClosing)
throws DatabaseException
setHandleLockOwner in class LockerDatabaseExceptionpublic void registerCursor(CursorImpl cursor)
registerCursor in class LockerDatabaseException - in subclasses.public void unRegisterCursor(CursorImpl cursor)
unRegisterCursor in class Lockerpublic boolean lockingRequired()
Locker
lockingRequired in class Lockerpublic long getAbortLsn(long nodeId)
getAbortLsn in class Lockerpublic WriteLockInfo getWriteLockInfo(long nodeId)
getWriteLockInfo in class Locker
public void markDeleteAtTxnEnd(DatabaseImpl db,
boolean deleteAtCommit)
throws DatabaseException
Locker
markDeleteAtTxnEnd in class LockerDatabaseException
protected void addLock(Long nodeId,
LockType type,
LockGrantType grantStatus)
addLock in class Lockervoid removeLock(long nodeId)
removeLock in class Lockerpublic boolean createdNode(long nodeId)
createdNode in class Locker
void moveWriteToReadLock(long nodeId,
Lock lock)
moveWriteToReadLock in class Locker
public StatGroup collectStats()
throws DatabaseException
collectStats in class LockerDatabaseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||