|
|||||||||
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
com.sleepycat.je.rep.txn.MasterTxn
public class MasterTxn
A MasterTxn represents a user initiated Txn executed on the Master node. This class uses the hooks defined by Txn to support the durability requirements of a replicated transaction on the Master.
Nested Class Summary | |
---|---|
static interface |
MasterTxn.MasterTxnFactory
|
Field Summary |
---|
Fields inherited from class com.sleepycat.je.txn.Txn |
---|
ACCUMULATED_LIMIT, commitLsn, deletedDatabases, firstLoggedLsn, lastLoggedLsn, repContext, undoDatabases |
Fields inherited from class com.sleepycat.je.txn.Locker |
---|
defaultNoWait, deleteInfo, envImpl, handleLockToHandleMap, handleToHandleLockMap, id, lockManager, readUncommittedDefault, thread |
Constructor Summary | |
---|---|
MasterTxn(EnvironmentImpl envImpl,
TransactionConfig config,
NameIdPair nameIdPair)
|
Method Summary | |
---|---|
static MasterTxn |
create(EnvironmentImpl envImpl,
TransactionConfig config,
NameIdPair nameIdPair)
|
protected long |
generateId(TxnManager txnManager,
long ignore)
MasterTxns use txn ids from a reserved negative space. |
CommitToken |
getCommitToken()
Returns the transaction commit token used to identify the transaction. |
VLSN |
getCommitVLSN()
|
int |
getCurrentRequiredAckCount()
|
protected int |
getReplicatorNodeId()
A masterTxn always writes its own id into the commit or abort. |
int |
getRequiredAckCount()
|
long |
getStartMs()
|
boolean |
isReplicationDefined()
Used for debugging checks to ensure that replication-defined lockers are used for accessing replicated databases. |
long |
messageTransferMs()
Returns the amount of time it took to copy the commit record from the log buffer to the rep stream. |
protected void |
postLogAbortHook()
Invoked if the transaction associated with the preLogCommitHook was subsequently aborted, for example due to a lack of disk space. |
protected void |
postLogCommitHook(LogItem commitItem)
This hook is invoked after the commit record has been written to the log, but before write locks have been released, so that other application cannot see the changes made by the transaction. |
protected void |
preLogCommitHook()
This hook is invoked before the commit of a transaction that made changes to a replicated environment. |
protected boolean |
propagatePostCommitException(DatabaseException postCommitException)
Identifies exceptions that may be propagated back to the caller during the postCommit phase of a transaction commit. |
void |
resetRequiredAckCount()
|
static void |
setFactory(MasterTxn.MasterTxnFactory factory)
Method used for unit testing. |
void |
stampRepWriteTime()
|
protected void |
txnBeginHook(TransactionConfig config)
Causes the transaction to wait until we have sufficient replicas to acknowledge the commit. |
Methods inherited from class com.sleepycat.je.txn.Locker |
---|
addDeleteInfo, addToHandleMaps, demoteLock, dumpLockTable, getDefaultNoWait, getId, getInitialLockTimeout, getLockTimeout, getPreemptable, getTxnTimeout, isReadUncommittedDefault, isTimedOut, lock, nonBlockingLock, openCursorHook, operationEnd, operationEnd, releaseLock, setClosingLocker, setLockTimeout, setPreemptable, setPreempted, setTxnTimeout, sharesLocksWith, toString, transferHandleLock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MasterTxn(EnvironmentImpl envImpl, TransactionConfig config, NameIdPair nameIdPair) throws DatabaseException
DatabaseException
Method Detail |
---|
public CommitToken getCommitToken()
getCommitToken
in class Txn
Txn.getCommitToken()
public VLSN getCommitVLSN()
protected long generateId(TxnManager txnManager, long ignore)
generateId
in class Txn
protected void txnBeginHook(TransactionConfig config) throws DatabaseException
txnBeginHook
in class Txn
config
- the transaction config that applies to the txn
DatabaseException
- if there is a failureprotected void preLogCommitHook() throws DatabaseException
Txn
preLogCommitHook
in class Txn
DatabaseException
- if there was a problem and that the
transaction should be aborted.protected void postLogCommitHook(LogItem commitItem) throws DatabaseException
Txn
postLogCommitHook
in class Txn
commitItem
- the commit item that was just logged
DatabaseException
- to indicate that there was a replication
related problem that needs to be communicated back to the application.protected void postLogAbortHook()
Txn
postLogAbortHook
in class Txn
public int getRequiredAckCount()
public int getCurrentRequiredAckCount()
public void resetRequiredAckCount()
protected int getReplicatorNodeId()
getReplicatorNodeId
in class Txn
public long getStartMs()
public void stampRepWriteTime()
public long messageTransferMs()
protected boolean propagatePostCommitException(DatabaseException postCommitException)
Txn
propagatePostCommitException
in class Txn
postCommitException
- the exception being evaluated
public static MasterTxn create(EnvironmentImpl envImpl, TransactionConfig config, NameIdPair nameIdPair)
public static void setFactory(MasterTxn.MasterTxnFactory factory)
public boolean isReplicationDefined()
Locker
isReplicationDefined
in class Locker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |