Class JournalCompleteRecordTX
- java.lang.Object
-
- org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord
-
- org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX
-
- All Implemented Interfaces:
EncodingSupport
public class JournalCompleteRecordTX extends JournalInternalRecord
A transaction record (Commit or Prepare), will hold the number of elements the transaction has in the current file.
While loading the
JournalFile, the number of operations found is matched against this number. If for any reason there are missing operations, the transaction will be ignored.We can't just use a global counter as reclaiming could delete files after the transaction was successfully committed. That also means not having a whole file on journal-reload doesn't mean we have to invalidate the transaction
The commit operation itself is not included in this total.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJournalCompleteRecordTX.TX_RECORD_TYPE
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord
compactCount, fileID
-
-
Constructor Summary
Constructors Constructor Description JournalCompleteRecordTX(JournalCompleteRecordTX.TX_RECORD_TYPE isCommit, long txID, EncodingSupport transactionData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(org.apache.activemq.artemis.api.core.ActiveMQBuffer buffer)intgetEncodeSize()intgetNumberOfRecords()voidsetNumberOfRecords(int records)-
Methods inherited from class org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord
decode, getCompactCount, getFileID, setCompactCount, setFileID
-
-
-
-
Constructor Detail
-
JournalCompleteRecordTX
public JournalCompleteRecordTX(JournalCompleteRecordTX.TX_RECORD_TYPE isCommit, long txID, EncodingSupport transactionData)
-
-
Method Detail
-
encode
public void encode(org.apache.activemq.artemis.api.core.ActiveMQBuffer buffer)
-
setNumberOfRecords
public void setNumberOfRecords(int records)
- Overrides:
setNumberOfRecordsin classJournalInternalRecord
-
getNumberOfRecords
public int getNumberOfRecords()
- Overrides:
getNumberOfRecordsin classJournalInternalRecord
-
getEncodeSize
public int getEncodeSize()
- Specified by:
getEncodeSizein interfaceEncodingSupport- Specified by:
getEncodeSizein classJournalInternalRecord
-
-