Class JournalTransaction
java.lang.Object
org.apache.activemq.artemis.core.journal.impl.JournalTransaction
- All Implemented Interfaces:
IOCallback
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNegative(JournalFile file, long id) voidaddPositive(JournalFile file, long id, int size, boolean replaceableRecord) voidvoidclear()voidcommit(JournalFile file) The caller of this method needs to guarantee appendLock.lock at the journal.voidcountUp()voiddone()Method for sync notifications.voidfillNumberOfRecords(JournalFile currentFile, JournalInternalRecord data) voidforget()Used by load, when the transaction was not loaded correctlyintgetCounter(JournalFile file) intlonggetId()long[]voidincCounter(JournalFile file) voidmerge(JournalTransaction other) This is used to merge transactions from compactingvoidMethod for error notifications.voidprepare(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 affectedvoidreplaceRecordProvider(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. or else potFilesMap could be affectedvoidvoidsetDelegateCompletion(IOCallback delegateCompletion) toString()
-
Constructor Details
-
JournalTransaction
-
-
Method Details
-
replaceRecordProvider
-
getId
public long getId() -
getCounter
-
incCounter
-
getPositiveArray
public long[] getPositiveArray() -
setCompacting
public void setCompacting() -
merge
This is used to merge transactions from compacting -
clear
public void clear() -
fillNumberOfRecords
-
checkErrorCondition
-
addPositive
-
addNegative
-
commit
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). -
rollback
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
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 -
toString
-
countUp
public void countUp() -
done
public void done()Description copied from interface:IOCallbackMethod for sync notifications. When this callback method is called, there is a guarantee the data is written on the disk.Note:Leave this method as soon as possible, or you would be blocking the whole notification thread
- Specified by:
donein interfaceIOCallback
-
onError
Description copied from interface:IOCallbackMethod for error notifications. Observation: The whole file will be probably failing if this happens. Like, if you delete the file, you will start to get errors for these operations- Specified by:
onErrorin interfaceIOCallback
-
getDelegateCompletion
-
setDelegateCompletion
-
getErrorMessage
-
getErrorCode
public int getErrorCode()
-