static class TxWrapper.TxWrapperHelper
extends java.lang.Object
TxWrapper.WorkArea state without context-local lookups.| Modifier and Type | Field and Description |
|---|---|
private TxWrapper.WorkArea |
wa
The
TxWrapper.WorkArea instance. |
| Constructor and Description |
|---|
TxWrapperHelper(TxWrapper.WorkArea wa)
Initialize this helper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
beginTx(boolean inTx,
boolean fullTx,
int blockDepth)
Executes logic to explicitly begin a transaction.
|
void |
cleanDirtyBuffers(java.util.Map<java.lang.String,RecordBuffer> allBuffers)
Remove all the buffers from the dirty buffers scope.
|
(package private) void |
deregisterDynamicBuffer(RecordBuffer buffer)
Deregister the given, dynamic record buffer by removing it from the buffer manager's tracking.
|
void |
endTx(boolean inTx,
boolean fullTx)
Executes logic to explicitly end a transaction.
|
void |
endTxPost()
Executes logic required after a full transaction has ended.
|
long |
getScopeTransitions()
Get the number of block scope transitions made.
|
long |
getTransactionCount()
Get the current counter value of application-leve transactions which have been opened.
|
boolean |
isImportantBlockTransition()
Indicate whether the current block is "important" from the standpoint of transitioning into
or out of its scope.
|
boolean |
isTransaction()
Check whether the current block is within an application-level transaction.
|
void |
maybeActivateTxWrapper(Database database)
Given a database which has one or more buffers with an open scope operating within an application
level transaction, possibly activate the transaction wrapper associated with that database.
|
void |
notifyRecordWasLoaded(RecordBuffer recordBuffer)
Notify the buffer manager that a new record was loaded (or the old record was reloaded)
into the specified record buffer.
|
(package private) void |
recordFlushed(RecordBuffer buffer,
int dmoId)
Notification that a record has been flushed.
|
void |
registerDirtyBuffer(RecordBuffer recordBuffer)
Register this buffer as 'dirty' in the current scope.
|
void |
registerPendingScopeable()
Register the
TxWrapper.WorkArea scopeable as pending, to be added to the next block. |
void |
trackDatabase(RecordBuffer buffer,
boolean add)
Track the buffer's database.
|
private final TxWrapper.WorkArea wa
TxWrapper.WorkArea instance.public TxWrapperHelper(TxWrapper.WorkArea wa)
wa - The TxWrapper.WorkArea instance.public void registerDirtyBuffer(RecordBuffer recordBuffer)
This registration doesn't mean that at the time of TxWrapper.commit(boolean), TxWrapper.rollback(boolean), or
TxWrapper.validate(boolean, boolean) the buffer's record is still 'dirty' - this is used to limit the set of buffers
receiving such notifications, to avoid iterating over all BufferManager.openBuffers.
recordBuffer - The record buffer.void recordFlushed(RecordBuffer buffer, int dmoId)
buffer - The buffer instance.dmoId - The DMO id.void deregisterDynamicBuffer(RecordBuffer buffer)
buffer - Dynamic record buffer to be removed.public void beginTx(boolean inTx,
boolean fullTx,
int blockDepth)
inTx - Flag indicating if we are in a transaction.fullTx - Flag indicating if we are in a full transaction.blockDepth - The current block depth (all blocks tracked by the TransactionManager).public void endTx(boolean inTx,
boolean fullTx)
inTx - Flag indicating if we are in a transaction.fullTx - Flag indicating if we are in a full transaction.public void endTxPost()
public boolean isTransaction()
true if we are in a transaction, else false.public long getScopeTransitions()
public long getTransactionCount()
public void trackDatabase(RecordBuffer buffer, boolean add)
TxWrapper.WorkArea.activeDatabases counter when
a new buffer is activated, and decrement it when it exists its scope.buffer - The buffer to track.add - Flag indicating if the buffer is opening or closing the scope.java.lang.IllegalStateException - If we are removing an active buffer and there is no entry for it in
TxWrapper.WorkArea.activeDatabases.public void maybeActivateTxWrapper(Database database)
If the transaction wrapper for the given database already is active, do nothing.
database - Database with at least one buffer with an open scope.public boolean isImportantBlockTransition()
This notion of importance is used to determine whether the various scoped data structures managed by this class need to add or delete a scope when transitioning into or out of the block, respectively, and whether we need to perform processing (e.g., copying/moving data between scopes) associated with such transitions.
true if the block is considered "important" by the above criteria, else
false.public void registerPendingScopeable()
TxWrapper.WorkArea scopeable as pending, to be added to the next block.public void notifyRecordWasLoaded(RecordBuffer recordBuffer)
recordBuffer - The record buffer in which a record was loaded (or the old record was reloaded).public void cleanDirtyBuffers(java.util.Map<java.lang.String,RecordBuffer> allBuffers)
allBuffers - The buffers to remove.