|
|||||||||
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 concrete Locker that simply tracks locks and releases them when operationEnd is called.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.txn.Locker |
---|
defaultNoWait, deleteInfo, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, lockTimeOutMillis, readUncommittedDefault, thread |
Constructor Summary | |
---|---|
BasicLocker(EnvironmentImpl env)
Creates a BasicLocker. |
Method Summary | |
---|---|
(package private) void |
addLock(java.lang.Long nodeId,
LockType type,
LockGrantType grantStatus)
Add a lock to set owned by this transaction. |
protected void |
checkState(boolean ignoreCalledByAbort)
|
LockStats |
collectStats(LockStats stats)
stats |
boolean |
createdNode(long nodeId)
Always false for this txn. |
protected long |
generateId(TxnManager txnManager)
BasicLockers always have a fixed id, because they are never used for recovery. |
long |
getAbortLsn(long nodeId)
|
long |
getOwnerAbortLsn(long nodeId)
Get the abort LSN for this node in the txn that owns the lock on this node. |
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. |
(package private) 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()
Creates a new instance of this txn for the same environment. |
void |
operationEnd()
Release locks at the end of the transaction. |
void |
operationEnd(boolean operationOK)
Release locks at the end of the transaction. |
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 com.sleepycat.je.txn.Locker |
---|
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getDefaultNoWait, getId, getLockTimeout, getTxnStartMillis, getTxnTimeOut, getWaitingFor, isHandleLockTransferrable, isReadUncommittedDefault, isTimedOut, lock, nonBlockingLock, operationEnd, releaseLock, setLockTimeout, setOnlyAbortable, setTxnTimeout, setWaitingFor, sharesLocksWith, toString, transferHandleLock, transferHandleLockToHandle, unregisterHandle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicLocker(EnvironmentImpl env) throws DatabaseException
DatabaseException
Method Detail |
---|
protected long generateId(TxnManager txnManager)
generateId
in class Locker
protected void checkState(boolean ignoreCalledByAbort) throws DatabaseException
checkState
in class Locker
DatabaseException
LockResult lockInternal(long nodeId, LockType lockType, boolean noWait, DatabaseImpl database) throws DatabaseException
Locker
lockInternal
in class Locker
nodeId
- 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 LockNotGrantedException if the lock
cannot be granted without waiting.database
- is the database containing nodeId.
DeadlockException
- if acquiring a blocking lock would result in a
deadlock.
DatabaseException
Locker.lockInternal(long, com.sleepycat.je.txn.LockType, boolean, com.sleepycat.je.dbi.DatabaseImpl)
public Locker getWriteOwnerLocker(long nodeId) throws DatabaseException
DatabaseException
public long getOwnerAbortLsn(long nodeId) throws DatabaseException
DatabaseException
public boolean isTransactional()
isTransactional
in class Locker
public boolean isSerializableIsolation()
isSerializableIsolation
in class Locker
public boolean isReadCommittedIsolation()
isReadCommittedIsolation
in class Locker
public Txn getTxnLocker()
getTxnLocker
in class Locker
public Locker newNonTxnLocker() throws DatabaseException
newNonTxnLocker
in class Locker
DatabaseException
public void releaseNonTxnLocks() throws DatabaseException
releaseNonTxnLocks
in class Locker
DatabaseException
public void operationEnd() throws DatabaseException
operationEnd
in class Locker
DatabaseException
public void operationEnd(boolean operationOK) throws DatabaseException
operationEnd
in class Locker
operationOK
- is whether the operation succeeded, since
that may impact ending behavior. (i.e for AutoTxn)
DatabaseException
public void setHandleLockOwner(boolean operationOK, Database dbHandle, boolean dbIsClosing) throws DatabaseException
setHandleLockOwner
in class Locker
DatabaseException
public void registerCursor(CursorImpl cursor) throws DatabaseException
registerCursor
in class Locker
DatabaseException
public void unRegisterCursor(CursorImpl cursor) throws DatabaseException
unRegisterCursor
in class Locker
DatabaseException
public long getAbortLsn(long nodeId) throws DatabaseException
getAbortLsn
in class Locker
DatabaseException
public WriteLockInfo getWriteLockInfo(long nodeId) throws DatabaseException
getWriteLockInfo
in class Locker
DatabaseException
public void markDeleteAtTxnEnd(DatabaseImpl db, boolean deleteAtCommit) throws DatabaseException
Locker
markDeleteAtTxnEnd
in class Locker
DatabaseException
void addLock(java.lang.Long nodeId, LockType type, LockGrantType grantStatus) throws DatabaseException
addLock
in class Locker
DatabaseException
void removeLock(long nodeId) throws DatabaseException
removeLock
in class Locker
DatabaseException
public boolean createdNode(long nodeId) throws DatabaseException
createdNode
in class Locker
DatabaseException
void moveWriteToReadLock(long nodeId, Lock lock)
moveWriteToReadLock
in class Locker
public LockStats collectStats(LockStats stats) throws DatabaseException
collectStats
in class Locker
DatabaseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |