|
||||||||||
| 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.Txn
A Txn is one that's created by a call to Environment.txnBegin. This class must support multithreaded use.
| Field Summary | |
static byte |
TXN_NOSYNC
|
static byte |
TXN_SYNC
|
static byte |
TXN_WRITE_NOSYNC
|
| Fields inherited from class com.sleepycat.je.txn.Locker |
defaultNoWait, deleteInfo, dirtyReadDefault, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, lockTimeOutMillis, thread |
| Constructor Summary | |
Txn()
Constructor for reading from log. |
|
Txn(EnvironmentImpl envImpl,
TransactionConfig config)
Create a transaction from Environment.txnBegin. |
|
| Method Summary | |
long |
abort()
Abort this transaction. |
(package private) void |
addLock(Long nodeId,
Lock lock,
LockType type,
LockGrantType grantStatus,
MemoryBudget mb)
Add lock to the appropriate queue. |
void |
addLogInfo(long nodeId,
long lastLsn)
Called by the log manager when logging a transaction aware object. |
protected void |
checkState(boolean calledByAbort)
Throw an exception if the transaction is not open. |
LockStats |
collectStats(LockStats stats)
stats |
long |
commit()
Call commit() with the default sync configuration property. |
long |
commit(byte flushSyncBehavior)
Commit this transaction 1. |
boolean |
createdNode(long nodeId)
|
void |
dumpLog(StringBuffer sb,
boolean verbose)
Write the object into the string buffer for log dumping. |
protected long |
generateId(TxnManager txnManager)
UserTxns get a new unique id for each instance. |
boolean |
getAbortKnownDeleted(long nodeId)
|
long |
getAbortLsn(long nodeId)
|
(package private) long |
getFirstActiveLsn()
|
(package private) int |
getInMemorySize()
|
(package private) long |
getLastLsn()
Access to last LSN. |
int |
getLogSize()
|
long |
getTransactionId()
|
boolean |
isHandleLockTransferrable()
|
boolean |
isSerializableIsolation()
Is serializable isolation. |
boolean |
isTransactional()
Is transactional. |
LockResult |
lock(long nodeId,
LockType lockType,
DatabaseImpl database)
Gets a lock on this nodeId and, if it is a write lock, saves an abort lsn. |
boolean |
logEntryIsTransactional()
|
void |
markDeleteAtTxnEnd(DatabaseImpl dbImpl,
boolean deleteAtCommit,
MemoryBudget mb)
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,
MemoryBudget mb)
A lock is being demoted. |
Locker |
newInstance()
Asserts false and returns null since only ThreadLocker should be cloned. |
void |
operationEnd()
Created transactions do nothing at the end of the operation. |
void |
operationEnd(boolean operationOK)
Created transactions do nothing at the end of the operation. |
void |
readFromLog(ByteBuffer logBuffer)
Initialize this object from the data in itemBuf. |
void |
registerCursor(CursorImpl cursor)
Cursors operating under this transaction are added to the collection. |
(package private) void |
removeLock(long nodeId,
Lock lock)
Remove the lock from the set owned by this transaction. |
void |
setHandleLockOwner(boolean operationOK,
Database dbHandle,
boolean dbIsClosing)
Created transactions don't transfer locks until commit. |
(package private) void |
setOnlyAbortable()
Set the state of a transaction to ONLY_ABORTABLE. |
void |
unRegisterCursor(CursorImpl cursor)
Remove a cursor from the collection. |
void |
writeToLog(ByteBuffer logBuffer)
Serialize this object into the buffer. |
| Methods inherited from class com.sleepycat.je.txn.Locker |
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getId, getLockTimeout, getTxnStartMillis, getTxnTimeOut, getWaitingFor, isDirtyReadDefault, isTimedOut, operationEnd, releaseLock, rememberHandleWriteLock, setLockTimeout, setTxnTimeout, setWaitingFor, sharesLocksWith, toString, transferHandleLock, transferHandleLockToHandle, unregisterHandle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final byte TXN_NOSYNC
public static final byte TXN_WRITE_NOSYNC
public static final byte TXN_SYNC
| Constructor Detail |
public Txn(EnvironmentImpl envImpl,
TransactionConfig config)
throws DatabaseException
public Txn()
| Method Detail |
protected long generateId(TxnManager txnManager)
generateId in class Lockerlong getLastLsn()
public LockResult lock(long nodeId,
LockType lockType,
DatabaseImpl database)
throws DatabaseException
lock in class LockerDatabaseException
public long commit()
throws DatabaseException
DatabaseException
public long commit(byte flushSyncBehavior)
throws DatabaseException
DatabaseException
public long abort()
throws DatabaseException
DatabaseException
public void addLogInfo(long nodeId,
long lastLsn)
throws DatabaseException
DatabaseException
long getFirstActiveLsn()
throws DatabaseException
DatabaseException
public void markDeleteAtTxnEnd(DatabaseImpl dbImpl,
boolean deleteAtCommit,
MemoryBudget mb)
throws DatabaseException
Locker
markDeleteAtTxnEnd in class LockerdbImpl - databaseImpl to removedeleteAtCommit - true if this databaseImpl should be cleaned on
commit, false if it should be cleaned on abort.mb - environment memory budget.
DatabaseException
void addLock(Long nodeId,
Lock lock,
LockType type,
LockGrantType grantStatus,
MemoryBudget mb)
throws DatabaseException
addLock in class LockerDatabaseException
void removeLock(long nodeId,
Lock lock)
throws DatabaseException
removeLock in class LockerDatabaseException
void moveWriteToReadLock(long nodeId,
Lock lock,
MemoryBudget mb)
moveWriteToReadLock in class Locker
public boolean createdNode(long nodeId)
throws DatabaseException
createdNode in class LockerDatabaseException
public long getAbortLsn(long nodeId)
throws DatabaseException
getAbortLsn in class LockerDatabaseException
public boolean getAbortKnownDeleted(long nodeId)
throws DatabaseException
getAbortKnownDeleted in class LockerDatabaseExceptionpublic boolean isTransactional()
isTransactional in class Lockerpublic boolean isSerializableIsolation()
isSerializableIsolation in class Locker
public Locker newInstance()
throws DatabaseException
newInstance in class LockerDatabaseException
public void operationEnd()
throws DatabaseException
operationEnd 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 AutoTxn)
DatabaseException
public void setHandleLockOwner(boolean operationOK,
Database dbHandle,
boolean dbIsClosing)
throws DatabaseException
setHandleLockOwner in class LockerDatabaseException
public void registerCursor(CursorImpl cursor)
throws DatabaseException
registerCursor in class LockerDatabaseException
public void unRegisterCursor(CursorImpl cursor)
throws DatabaseException
unRegisterCursor in class LockerDatabaseExceptionpublic boolean isHandleLockTransferrable()
isHandleLockTransferrable in class Locker
public LockStats collectStats(LockStats stats)
throws DatabaseException
collectStats in class LockerDatabaseExceptionvoid setOnlyAbortable()
setOnlyAbortable in class Locker
protected void checkState(boolean calledByAbort)
throws DatabaseException
checkState in class LockerDatabaseExceptionpublic int getLogSize()
getLogSize in interface LogWritableLogWritable.getLogSize()public void writeToLog(ByteBuffer logBuffer)
LogWritable
writeToLog in interface LogWritablelogBuffer - is the destination bufferLogWritable.writeToLog(java.nio.ByteBuffer)public void readFromLog(ByteBuffer logBuffer)
LogReadable
readFromLog in interface LogReadableIt's ok for FindBugs to whine about id not being synchronized.
public void dumpLog(StringBuffer sb,
boolean verbose)
LogReadable
dumpLog in interface LogReadablesb - destination string bufferverbose - if true, dump the full, verbose versionLogReadable.dumpLog(java.lang.StringBuffer, boolean)public long getTransactionId()
getTransactionId in interface LogReadableLogReadable.getTransactionId()public boolean logEntryIsTransactional()
logEntryIsTransactional in interface LogReadableLogReadable.logEntryIsTransactional()int getInMemorySize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||