Class XACommittingTx
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Flag indicating that the TM has called XALogger.putDone().private final int
workerID into the activeTx[] that this entry will be stored.private byte[]
byte[] representation of this.index.private long
the log key associated with the COMMIT record for this transactionprivate ByteBuffer
Used to putLong(logKey) into logKeyBytes.private byte[]
byte[] representation of logKey.(package private) byte[][]
data record for XADONE record generated by XALogger#putDone().private boolean
Flag indicating that the log overflow notification routine is in the process of moving this record.private byte[][]
reference to the COMMIT data record the TM wrote to the log. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final int
getIndex()
returns an workerID into an array of XACommittingTx objects that holds a reference to this XACommittingTx.final long
final byte[][]
returns the byte[][] containing the COMMIT record data.final boolean
isDone()
returns done as maintained by XALogger.putCommit() and XALogger.putDone().final boolean
isMoving()
(package private) final void
setDone
(boolean done) (package private) final void
setLogKey
(long logKey) sets the log key associated with the COMMIT record for this transaction.(package private) final void
setMoving
(boolean moving) used by logOverflowNotification to mark XACommittingTx entries in the process of being moved.(package private) final void
setRecord
(byte[][] record) saves a reference to the byte[][] containing the COMMIT record data.
-
Field Details
-
record
private byte[][] recordreference to the COMMIT data record the TM wrote to the log.TM must not change this record until the DONE record has been logged. Specifically, once the TM calls XALogger.putCommit() it must not change the byte[][] that was logged.
-
index
private final int indexworkerID into the activeTx[] that this entry will be stored.Each XACommittingTx instance is assigned a fixed slot in the activeTx[]. Entries in the activeTx[] are set to null when not in use.
When the XACommittingTx object is constructed, it is stored into the availableTx[] using workerID . The entry is removed
-
logKey
private long logKeythe log key associated with the COMMIT record for this transaction -
done
private boolean doneFlag indicating that the TM has called XALogger.putDone().initialized to false in XALogger.putCommit() and set to true in XALogger.putDone().
Examined by logOverflowNotification processor to determine if the entry needs to be moved. Entries that are marked
-
moving
private boolean movingFlag indicating that the log overflow notification routine is in the process of moving this record.To assure that the DONE record is always recorded after the COMMIT record, XALogger.putDone() must wait until moving is false before it writes the DONE record to the log.
-
logKeyBytes
private byte[] logKeyBytesbyte[] representation of logKey.Recorded to the log by XALogger#putDone as the record data of the XADONE record.
-
LogKeyBB
Used to putLong(logKey) into logKeyBytes. -
indexBytes
private byte[] indexBytesbyte[] representation of this.index.Recorded to the log by XALogger#putDone as a diagnostic aid.
-
logKeyData
byte[][] logKeyDatadata record for XADONE record generated by XALogger#putDone().
-
-
Constructor Details
-
XACommittingTx
XACommittingTx(int index) constructs a new XACommittingTx instance.
-
-
Method Details
-
getRecord
public final byte[][] getRecord()returns the byte[][] containing the COMMIT record data.This method is used by the log overflow notification processor to retrieve the original record data and write a new copy of the COMMIT record.
- Returns:
- the byte[][] containing the COMMIT record data.
-
setRecord
final void setRecord(byte[][] record) saves a reference to the byte[][] containing the COMMIT record data.- Parameters:
record
- the byte[][] that was passed to the putCommit() routine of XALogger.
-
getIndex
final int getIndex()returns an workerID into an array of XACommittingTx objects that holds a reference to this XACommittingTx.- Returns:
- an integer used as an workerID into an array of XATransactions.
-
getLogKey
public final long getLogKey()- Returns:
- the log key associated with the COMMIT record for this transaction.
-
setLogKey
final void setLogKey(long logKey) sets the log key associated with the COMMIT record for this transaction.also updates LogKeyBytes with byte[] form of logKey for subsequent recording in XADONE record.
- Parameters:
logKey
- a log key returned by Logger.put()
-
setDone
final void setDone(boolean done) - Parameters:
done
- false while transaction is in COMMITTING state. true when two-phase-commit completes.
-
isDone
public final boolean isDone()returns done as maintained by XALogger.putCommit() and XALogger.putDone().- Returns:
- boolean indicating whether the two-phase-commit processing is complete.
-
setMoving
final void setMoving(boolean moving) used by logOverflowNotification to mark XACommittingTx entries in the process of being moved.The XALogger.putDone() method waits until moving is false.
- Parameters:
moving
- boolean indicating that entry is being moved by logOverflowNotification routine.
-
isMoving
public final boolean isMoving()- Returns:
- true if logOverflowNotification routine is
moving the record.
The XALogger.putDone() method waits until moving is false.
-