| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private Object | |
| protected ContextService | |
| protected DataFactory | |
| protected DataValueFactory | |
| private boolean | |
| private boolean | |
| protected static final String | |
| protected LockFactory | |
| private LockingPolicy[][] | |
| protected LogFactory | |
| protected static final String | |
| protected static final String | |
| protected static final String | |
| protected DaemonService | |
| protected RawStoreFactory | |
| private final AtomicLong | tranId
The id of the next transaction to be started. |
| public TransactionTable | |
| protected static final String | |
| private UUIDFactory | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | addUpdateTransaction(TransactionId id, RawTransaction t, int transactionStatus)
Add a transaction to the list of transactions that has updated the raw store. |
| protected boolean | Returns: true if backup is blocked. false otherwise.if true, waits until the backup
is blocked. wait)Block the online backup. |
| public boolean | Returns: true if no backup blocking operations are in progress false otherwise.if true, waits for the current backup blocking
operation in progress to finish. wait)Implements org. Checks if there are any backup blocking operations in progress and prevents new ones from starting until the backup is finished. |
| public void | boot(boolean
True if the database should be created create, Properties Configuration properties properties)Implements org. Boot this module with the given properties. |
| private static Object | bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)
Must be private so that user code can't call this entry point. |
| public boolean | canSupport(Properties startParams)
Implements org. See if this implementation can support any attributes that are listed in properties. |
| public void | createFinished()
Implements org. Database creation finished |
| private static Object | findServiceModule(final Object serviceModule, final String factoryInterface)
Must be private so that user code can't call this entry point. |
| public boolean | findTransaction(TransactionId id, RawTransaction tran)
Implements org. Find the TransactionTableEntry with the given ID and make the passed in transaction assume the identity and properties of that TransactionTableEntry. |
| public RawTransaction | findUserTransaction(RawStoreFactory rsf, ContextManager contextMgr, String transName)
Implements org. Find a user transaction within the given raw store and the given contextMgr. |
| public LogInstant | firstUpdateInstant()
Implements org. Get the earliest log instant that is still active, ie, the first log record logged by the earliest transaction that is still active. |
| private static ContextService | |
| public LockFactory | getLockFactory()
Implements org. Get the LockFactory to use with this store. |
| pack-priv final LockingPolicy | getLockingPolicy(int mode, int isolation, boolean stricterOk)
Get a locking policy for a transaction. |
| private static ModuleFactory | |
| public TransactionInfo[] | |
| public Formatable | getTransactionTable()
Implements org. Return the transaction table to be logged with the checkpoint operation |
| public Object | getXAResourceManager()
Implements org. Return the module providing XAresource interface to the transaction table. |
| public void | handlePreparedXacts(RawStoreFactory rsf)
Implements org. Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager. |
| public boolean | Returns: true if there are prepared transactions in the transaction table, false otherwise.Implements org. Check if there are any prepared transanctions in the transaction table. |
| public boolean | |
| public UUID | |
| public StandardException | markCorrupt(StandardException originalError)
Implements org. Really this is just a convience routine for callers that might not have access to a log factory. |
| public boolean | noActiveUpdateTransaction()
Implements org. Returns true if there is no in flight updating tranasaction. |
| protected void | |
| protected void | pushTransactionContext(ContextManager cm, String
the name of the transaction context contextName, Xact the Transaction object xact, boolean if true, then any error will abort the whole
transaction. Otherwise, let XactContext.cleanupOnError decide what to
do abortAll, RawStoreFactory the raw store factory rsf, boolean during systeme quiesce, i.e., this transaction should
not be allowed to be active during a quiesce state. excludeMe)Create a new RawTransaction, a context for it and push the context onto the current context manager. |
| protected boolean | remove(TransactionId xactId)
remove the transaction Id an return false iff the transaction is found in the table and it doesn't need exclusion from quiesce state |
| protected void | removeUpdateTransaction(TransactionId id)
Remove a transaction from the list of transactions that has updated the raw store. |
| public void | resetTranId()
Implements org. Set the shortTranId, this is called by the log factory after recovery |
| public void | rollbackAllTransactions(RawTransaction
use this transaction to do all the user
transaction work recoveryTransaction, RawStoreFactory rsf)Implements org. Rollback all active transactions that has updated the raw store.</nl> |
| public void | |
| public void | setRawStoreFactory(RawStoreFactory rsf)
Implements org. make Transaction factory aware of which raw store factory it belongs to |
| private Xact | startCommonTransaction(RawStoreFactory
the raw store factory creating this xact. rsf, Xact parent transaction (if this is a nested user transaction) parentTransaction, ContextManager the current context manager to associate the xact with. cm, boolean readOnly, CompatibilitySpace if null, use the transaction being created, else if
non-null use this compatibilitySpace. compatibilitySpace, String xact_context_id, String transName, boolean excludeMe, boolean flush_log_on_xact_end)Common work done to create local or global transactions. |
| public RawTransaction | startGlobalTransaction(RawStoreFactory rsf, ContextManager
is the context manager to use. It must be the current
context manager. cm, int the format id part of the Xid - ie. Xid.getFormatId(). format_id, byte[] the global transaction identifier part of XID - ie.
Xid.getGlobalTransactionId(). global_id, byte[] The branch qualifier of the Xid - ie.
Xid.getBranchQaulifier() branch_id)Implements org. Start a new transaction within the given raw store. |
| public RawTransaction | startInternalTransaction(RawStoreFactory rsf, ContextManager cm)
Implements org. Start a new internal transaction within the given raw store. |
| public RawTransaction | startNestedReadOnlyUserTransaction(RawStoreFactory
the RawStoreFactory rsf, RawTransaction the parent transaction parentTransaction, CompatibilitySpace compatibility space to use for locks. compatibilitySpace, ContextManager is the context manager to use. It must be
the current context manager. cm, String is the transaction name. It will be
displayed in the transactiontable VTI. transName)Implements org. Start a new read only transaction within the given raw store. |
| public RawTransaction | startNestedTopTransaction(RawStoreFactory rsf, ContextManager cm)
Implements org. Start a new nested top transaction within the given raw store. |
| public RawTransaction | startNestedUpdateUserTransaction(RawStoreFactory
the RawStoreFactory rsf, RawTransaction the parent transaction parentTransaction, ContextManager is the context manager to use. It must
be the current context manager. cm, String is the transaction name. It will be
displayed in the transactiontable VTI. transName, boolean By default should the transaction commit
and abort be synced to the log. Normal
usage should pick true, unless there
is specific performance need and usage
works correctly if a commit can be
lost on system crash. flush_log_on_xact_end)Implements org. Start a new update transaction within the given raw store. |
| public RawTransaction | startTransaction(RawStoreFactory rsf, ContextManager
is the context manager to use. It must be the current
context manager. cm, String is the transaction name. It will be displayed in the
transactiontable VTI. transName)Implements org. Start a new transaction within the given raw store. |
| public void | |
| public boolean | submitPostCommitWork(Serviceable work)
Implements org. Submit this post commit work to the post commit daemon |
| protected void | |
| public void | unblockBackupBlockingOperations()
Implements org. Backup completed. |
| public void | useTransactionTable(Formatable transactionTable)
Implements org. Use this transaction table, which is gotten from a checkpoint operation. |
| backupBlockingOperations | back to summary |
|---|---|
| private long backupBlockingOperations | |
| backupSemaphore | back to summary |
|---|---|
| private Object backupSemaphore | |
| contextFactory | back to summary |
|---|---|
| protected ContextService contextFactory | |
| dataFactory | back to summary |
|---|---|
| protected DataFactory dataFactory | |
| dataValueFactory | back to summary |
|---|---|
| protected DataValueFactory dataValueFactory | |
| inBackup | back to summary |
|---|---|
| private boolean inBackup | |
| inCreateNoLog | back to summary |
|---|---|
| private boolean inCreateNoLog | |
| INTERNAL_CONTEXT_ID | back to summary |
|---|---|
| protected static final String INTERNAL_CONTEXT_ID | |
| lockFactory | back to summary |
|---|---|
| protected LockFactory lockFactory | |
| lockingPolicies | back to summary |
|---|---|
| private LockingPolicy[][] lockingPolicies | |
| logFactory | back to summary |
|---|---|
| protected LogFactory logFactory | |
| NESTED_READONLY_USER_CONTEXT_ID | back to summary |
|---|---|
| protected static final String NESTED_READONLY_USER_CONTEXT_ID | |
| NESTED_UPDATE_USER_CONTEXT_ID | back to summary |
|---|---|
| protected static final String NESTED_UPDATE_USER_CONTEXT_ID | |
| NTT_CONTEXT_ID | back to summary |
|---|---|
| protected static final String NTT_CONTEXT_ID | |
| rawStoreDaemon | back to summary |
|---|---|
| protected DaemonService rawStoreDaemon | |
| rawStoreFactory | back to summary |
|---|---|
| protected RawStoreFactory rawStoreFactory | |
| tranId | back to summary |
|---|---|
| private final AtomicLong tranId The id of the next transaction to be started. | |
| ttab | back to summary |
|---|---|
| public TransactionTable ttab | |
| USER_CONTEXT_ID | back to summary |
|---|---|
| protected static final String USER_CONTEXT_ID | |
| uuidFactory | back to summary |
|---|---|
| private UUIDFactory uuidFactory | |
| xa_resource | back to summary |
|---|---|
| private Object xa_resource | |
| XactFactory | back to summary |
|---|---|
| public XactFactory() | |
| add | back to summary |
|---|---|
| protected void add(Xact xact, boolean excludeMe) | |
| addUpdateTransaction | back to summary |
|---|---|
| protected void addUpdateTransaction(TransactionId id, RawTransaction t, int transactionStatus) Add a transaction to the list of transactions that has updated the raw store. This is called underneath the BeginXact log operation's doMe method. The logging system must guarentee that transactions are added in the true order they are started, as defined by the order of beginXact log record in the log. | |
| blockBackup | back to summary |
|---|---|
| protected boolean blockBackup(boolean wait) Block the online backup. Backup needs to be blocked while executing any unlogged operations or any opearation that prevents from making a consistent backup.
| |
| blockBackupBlockingOperations | back to summary |
|---|---|
| public boolean blockBackupBlockingOperations(boolean wait) Implements org. Checks if there are any backup blocking operations in progress and
prevents new ones from starting until the backup is finished.
If backup blocking operations are in progress and
| |
| boot | back to summary |
|---|---|
| public void boot(boolean create, Properties properties) throws StandardException Implements org. Doc from org. Boot this module with the given properties. Creates a module instance that can be found using the findModule() methods of Monitor. The module can only be found using one of these findModule() methods once this method has returned. An implementation's boot method can throw StandardException. If it is thrown the module is not registered by the monitor and therefore cannot be found through a findModule(). In this case the module's stop() method is not called, thus throwing this exception must free up any resources.
When create is true the contents of the properties object
will be written to the service.properties of the persistent
service. Thus any code that requires an entry in service.properties
must explicitly place the value in this properties set
using the put method.
When create is false the properties object contains all the properties set in the service.properties file plus a limited number of attributes from the JDBC URL attributes or connection properties set. This avoids properties set by the user compromising the boot process. An example of a property passed in from the JDBC world is the bootPassword for encrypted databases. Code should not hold onto the passed in properties reference after boot time as its contents may change underneath it. At least after the complete boot is completed, the links to all the default sets will be removed.
| |
| bootServiceModule | back to summary |
|---|---|
| private static Object bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties) throws StandardException Must be private so that user code can't call this entry point. | |
| canSupport | back to summary |
|---|---|
| public boolean canSupport(Properties startParams) Implements org. Doc from org. See if this implementation can support any attributes that are listed in properties. This call may be made on a newly created instance before the boot() method has been called, or after the boot method has been called for a running module.
The module can check for attributes in the properties to
see if it can fulfill the required behaviour. E.g. the raw
store may define an attribute called RawStore.Recoverable.
If a temporary raw store is required the property RawStore.recoverable=false
would be added to the properties before calling bootServiceModule. If a
raw store cannot support this attribute its canSupport method would
return null. Also see the Monitor class's prologue to see how the
identifier is used in looking up properties.
| |
| createFinished | back to summary |
|---|---|
| public void createFinished() throws StandardException Implements org. Database creation finished
| |
| findServiceModule | back to summary |
|---|---|
| private static Object findServiceModule(final Object serviceModule, final String factoryInterface) throws StandardException Must be private so that user code can't call this entry point. | |
| findTransaction | back to summary |
|---|---|
| public boolean findTransaction(TransactionId id, RawTransaction tran) Implements org. Find the TransactionTableEntry with the given ID and make the passed in transaction assume the identity and properties of that TransactionTableEntry. Used in recovery only. | |
| findUserTransaction | back to summary |
|---|---|
| public RawTransaction findUserTransaction(RawStoreFactory rsf, ContextManager contextMgr, String transName) throws StandardException Implements org. Doc from org. Find a user transaction within the given raw store and the given contextMgr. If no user transaction exist, then start one with name transName. This method will push a transaction context as described in RawStoreFactory.startTransaction
| |
| firstUpdateInstant | back to summary |
|---|---|
| public LogInstant firstUpdateInstant() Implements org. Get the earliest log instant that is still active, ie, the first log
record logged by the earliest transaction that is still active.
| |
| getContextService | back to summary |
|---|---|
| private static ContextService getContextService() Private so that user code can't call this entry point. | |
| getLockFactory | back to summary |
|---|---|
| public LockFactory getLockFactory() Implements org. Get the LockFactory to use with this store. | |
| getLockingPolicy | back to summary |
|---|---|
| pack-priv final LockingPolicy getLockingPolicy(int mode, int isolation, boolean stricterOk) Get a locking policy for a transaction. | |
| getMonitor | back to summary |
|---|---|
| private static ModuleFactory getMonitor() Must be private so that user code can't call this entry point. | |
| getTransactionInfo | back to summary |
|---|---|
| public TransactionInfo[] getTransactionInfo() Implements org. | |
| getTransactionTable | back to summary |
|---|---|
| public Formatable getTransactionTable() Implements org. Return the transaction table to be logged with the checkpoint operation | |
| getXAResourceManager | back to summary |
|---|---|
| public Object getXAResourceManager() throws StandardException Implements org. Return the module providing XAresource interface to the transaction table.
| |
| handlePreparedXacts | back to summary |
|---|---|
| public void handlePreparedXacts(RawStoreFactory rsf) throws StandardException Implements org. Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager. This includes creating a context manager for each, pushing a xact context, and reclaiming update locks on all data changed by the transaction. Expected to be called just after the redo and undo recovery loops, where the transaction table should be empty except for prepared xacts. Used only in recovery.
| |
| hasPreparedXact | back to summary |
|---|---|
| public boolean hasPreparedXact() Implements org. Check if there are any prepared transanctions in the transaction table. Caller must be aware that if there is no other mechanism to stop transactions from starting and ending, then this information is outdated as soon as it is reported.
| |
| inDatabaseCreation | back to summary |
|---|---|
public boolean inDatabaseCreation()
| |
| makeNewUUID | back to summary |
|---|---|
| public UUID makeNewUUID() Make a new UUID for whomever that wants it | |
| markCorrupt | back to summary |
|---|---|
| public StandardException markCorrupt(StandardException originalError) Implements org. Really this is just a convience routine for callers that might not have access to a log factory.
| |
| noActiveUpdateTransaction | back to summary |
|---|---|
| public boolean noActiveUpdateTransaction() Implements org. Returns true if there is no in flight updating tranasaction. Caller must be aware that if there is no other mechanism to stop transactions from starting and ending, then this information is outdated as soon as it is reported. Only call this function in special times - e.g, during recovery | |
| prepareTransaction | back to summary |
|---|---|
| protected void prepareTransaction(TransactionId id) Change state of transaction to prepared. Used by recovery to update the transaction table entry to prepared state. | |
| pushTransactionContext | back to summary |
|---|---|
| protected void pushTransactionContext(ContextManager cm, String contextName, Xact xact, boolean abortAll, RawStoreFactory rsf, boolean excludeMe) throws StandardException Create a new RawTransaction, a context for it and push the context onto the current context manager. Then add the transacion to the transaction table.
| |
| remove | back to summary |
|---|---|
| protected boolean remove(TransactionId xactId) remove the transaction Id an return false iff the transaction is found in the table and it doesn't need exclusion from quiesce state | |
| removeUpdateTransaction | back to summary |
|---|---|
| protected void removeUpdateTransaction(TransactionId id) Remove a transaction from the list of transactions that has updated the raw store. | |
| resetTranId | back to summary |
|---|---|
| public void resetTranId() Implements org. Set the shortTranId, this is called by the log factory after recovery | |
| rollbackAllTransactions | back to summary |
|---|---|
| public void rollbackAllTransactions(RawTransaction recoveryTransaction, RawStoreFactory rsf) throws StandardException Implements org. Rollback all active transactions that has updated the raw store. Use the recovery Transaction that is passed in to do all the work. Used in recovery only. Transactions are rolled back in the following order:
| |
| setNewTransactionId | back to summary |
|---|---|
| public void setNewTransactionId(TransactionId oldxid, Xact t) | |
| setRawStoreFactory | back to summary |
|---|---|
| public void setRawStoreFactory(RawStoreFactory rsf) throws StandardException Implements org. Doc from org. make Transaction factory aware of which raw store factory it belongs to | |
| startCommonTransaction | back to summary |
|---|---|
| private Xact startCommonTransaction(RawStoreFactory rsf, Xact parentTransaction, ContextManager cm, boolean readOnly, CompatibilitySpace compatibilitySpace, String xact_context_id, String transName, boolean excludeMe, boolean flush_log_on_xact_end) throws StandardException Common work done to create local or global transactions.
| |
| startGlobalTransaction | back to summary |
|---|---|
| public RawTransaction startGlobalTransaction(RawStoreFactory rsf, ContextManager cm, int format_id, byte[] global_id, byte[] branch_id) throws StandardException Implements org. Doc from org. Start a new transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startTransaction
| |
| startInternalTransaction | back to summary |
|---|---|
| public RawTransaction startInternalTransaction(RawStoreFactory rsf, ContextManager cm) throws StandardException Implements org. Doc from org. Start a new internal transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startInternalTransaction
| |
| startNestedReadOnlyUserTransaction | back to summary |
|---|---|
| public RawTransaction startNestedReadOnlyUserTransaction(RawStoreFactory rsf, RawTransaction parentTransaction, CompatibilitySpace compatibilitySpace, ContextManager cm, String transName) throws StandardException Implements org. Doc from org. Start a new read only transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTransaction
| |
| startNestedTopTransaction | back to summary |
|---|---|
| public RawTransaction startNestedTopTransaction(RawStoreFactory rsf, ContextManager cm) throws StandardException Implements org. Doc from org. Start a new nested top transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTopTransaction
| |
| startNestedUpdateUserTransaction | back to summary |
|---|---|
| public RawTransaction startNestedUpdateUserTransaction(RawStoreFactory rsf, RawTransaction parentTransaction, ContextManager cm, String transName, boolean flush_log_on_xact_end) throws StandardException Implements org. Doc from org. Start a new update transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTransaction
| |
| startTransaction | back to summary |
|---|---|
| public RawTransaction startTransaction(RawStoreFactory rsf, ContextManager cm, String transName) throws StandardException Implements org. Doc from org. Start a new transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startTransaction
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop the module. The module may be found via a findModule() method until some time after this method returns. Therefore the factory must be prepared to reject requests to it once it has been stopped. In addition other modules may cache a reference to the module and make requests of it after it has been stopped, these requests should be rejected as well. | |
| submitPostCommitWork | back to summary |
|---|---|
| public boolean submitPostCommitWork(Serviceable work) Implements org. Submit this post commit work to the post commit daemon
| |
| unblockBackup | back to summary |
|---|---|
| protected void unblockBackup() Unblock the backup, a backup blocking operation finished. | |
| unblockBackupBlockingOperations | back to summary |
|---|---|
| public void unblockBackupBlockingOperations() Implements org. Backup completed. Allow backup blocking operations. | |
| useTransactionTable | back to summary |
|---|---|
| public void useTransactionTable(Formatable transactionTable) throws StandardException Implements org. Use this transaction table, which is gotten from a checkpoint operation. Use ONLY during recovery.
| |