Class JournalTransaction
- java.lang.Object
-
- org.apache.activemq.artemis.core.journal.impl.JournalTransaction
-
public class JournalTransaction extends Object
-
-
Constructor Summary
Constructors Constructor Description JournalTransaction(long id, JournalRecordProvider journal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNegative(JournalFile file, long id)voidaddPositive(JournalFile file, long id, int size, boolean replaceableRecord)voidcheckErrorCondition()voidclear()voidcommit(JournalFile file)The caller of this method needs to guarantee appendLock.lock at the journal.voidfillNumberOfRecords(JournalFile currentFile, JournalInternalRecord data)voidforget()Used by load, when the transaction was not loaded correctlyTransactionCallbackgetCallback(JournalFile file)intgetCounter(JournalFile file)TransactionCallbackgetCurrentCallback()longgetId()long[]getPositiveArray()voidincCounter(JournalFile file)voidmerge(JournalTransaction other)This is used to merge transactions from compactingvoidprepare(JournalFile file)The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context.voidreplaceRecordProvider(JournalRecordProvider provider)voidrollback(JournalFile file)The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context.voidsetCompacting()StringtoString()voidwaitCallbacks()voidwaitCompletion()Wait completion at the latest file only
-
-
-
Constructor Detail
-
JournalTransaction
public JournalTransaction(long id, JournalRecordProvider journal)
-
-
Method Detail
-
replaceRecordProvider
public void replaceRecordProvider(JournalRecordProvider provider)
-
getId
public long getId()
- Returns:
- the id
-
getCounter
public int getCounter(JournalFile file)
-
incCounter
public void incCounter(JournalFile file)
-
getPositiveArray
public long[] getPositiveArray()
-
setCompacting
public void setCompacting()
-
merge
public void merge(JournalTransaction other)
This is used to merge transactions from compacting
-
clear
public void clear()
-
fillNumberOfRecords
public void fillNumberOfRecords(JournalFile currentFile, JournalInternalRecord data)
- Parameters:
currentFile-data-
-
getCurrentCallback
public TransactionCallback getCurrentCallback()
-
getCallback
public TransactionCallback getCallback(JournalFile file) throws Exception
- Throws:
Exception
-
addPositive
public void addPositive(JournalFile file, long id, int size, boolean replaceableRecord)
-
addNegative
public void addNegative(JournalFile file, long id)
-
commit
public void commit(JournalFile file)
The caller of this method needs to guarantee appendLock.lock at the journal. (unless this is being called from load what is a single thread process).
-
waitCallbacks
public void waitCallbacks() throws InterruptedException- Throws:
InterruptedException
-
waitCompletion
public void waitCompletion() throws ExceptionWait completion at the latest file only- Throws:
Exception
-
rollback
public void rollback(JournalFile file)
The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context. or else potFilesMap could be affected
-
prepare
public void prepare(JournalFile file)
The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context. or else potFilesMap could be affected
-
forget
public void forget()
Used by load, when the transaction was not loaded correctly
-
-