Modifier and Type | Class and Description |
---|---|
static interface |
MasterTxn.MasterTxnFactory |
ACCUMULATED_LIMIT, commitLsn, deletedDatabases, firstLoggedLsn, lastLoggedLsn, openedDatabaseHandles, repContext, undoDatabases
defaultNoWait, deleteInfo, envImpl, id, lockManager, readUncommittedDefault, thread
Constructor and Description |
---|
MasterTxn(EnvironmentImpl envImpl,
TransactionConfig config,
NameIdPair nameIdPair) |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
lockOnce()
Determines whether we should lock the block-latch lock.
|
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() |
protected void |
postLogCommitAbortHook()
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 |
preLogAbortHook() |
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.
|
boolean |
unlockOnce()
Determines whether we should unlock the block-latch lock.
|
abort, abort, abort, addLock, addLogInfo, addOpenedDatabase, checkPreempted, checkState, cleanupDatabaseImpls, clearWriteLocks, close, collectStats, commit, commit, commit, createdNode, createLocalAutoTxn, createLocalTxn, dumpLog, getCommitDurability, getDefaultDurability, getEnvironmentImpl, getExplicitDurabilityConfigured, getExplicitSyncConfigured, getFirstActiveLsn, getImportunate, getLastLsn, getLogSize, getPrepared, getReadLockIds, getState, getTransaction, getTransactionId, getTriggerDbs, getTxnLocker, getWriteLockIds, getWriteLockInfo, isAutoTxn, isClosed, isOnlyAbortable, isReadCommittedIsolation, isRolledBack, isSerializableIsolation, isSuspended, isTransactional, isValid, lockingRequired, lockInternal, logicalEquals, markDeleteAtTxnEnd, newNonTxnLocker, nonTxnOperationEnd, noteTriggerDb, operationEnd, preLogWithoutLock, prepare, readFromLog, registerCursor, releaseNonTxnLocks, releaseWriteLocks, setDeletedDatabaseState, setImportunate, setOnlyAbortable, setPrepared, setRollback, setSuspended, setTransaction, undo, unRegisterCursor, updateLoggedForTxn, writeToLog
addDeleteInfo, allowReleaseLockAfterLsnChange, demoteLock, disallowReplicaWrite, dumpLockTable, getDefaultNoWait, getEnvironment, getId, getInitialLockTimeout, getLockTimeout, getPreemptable, getTxnTimeout, isReadUncommittedDefault, isTimedOut, lock, lockAfterLsnChange, nonBlockingLock, openCursorHook, operationEnd, operationEnd, releaseLock, setClosingLocker, setLockTimeout, setPreemptable, setPreempted, setTxnTimeout, sharesLocksWith, toString
public MasterTxn(EnvironmentImpl envImpl, TransactionConfig config, NameIdPair nameIdPair) throws DatabaseException
DatabaseException
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 txnDatabaseException
- 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 loggedDatabaseException
- to indicate that there was a replication
related problem that needs to be communicated back to the application.protected void preLogAbortHook() throws DatabaseException
preLogAbortHook
in class Txn
DatabaseException
protected void postLogCommitAbortHook()
Txn
postLogCommitAbortHook
in class Txn
protected void postLogAbortHook()
postLogAbortHook
in class Txn
public boolean lockOnce()
We acquire the lock during pre-log hook, and release it during post-log hook. Specifically, there are the following cases:
preLogCommitHook()
and
release it in postLogCommitHook()
Txn.abort()
API), we acquire the lock in preLogAbortHook()
and
release it in postLogAbortHook()
.
Txn.throwPreCommitException()
, we go through the abort path as well.
In this case:
preLogCommitHook()
;
preLogAbortHook()
and postLogAbortHook()
as always;
postLogCommitAbortHook()
See additional javadoc at RepImpl.blockLatchLock
public boolean unlockOnce()
lockOnce()
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 evaluatedpublic static MasterTxn create(EnvironmentImpl envImpl, TransactionConfig config, NameIdPair nameIdPair)
public static void setFactory(MasterTxn.MasterTxnFactory factory)
public boolean isReplicationDefined()
Locker
isReplicationDefined
in class Locker
Copyright (c) 2004-2012 Oracle. All rights reserved.