Class PagedMessageImpl
java.lang.Object
org.apache.activemq.artemis.core.paging.impl.PagedMessageImpl
- All Implemented Interfaces:
EncodingSupport,PagedMessage
This class represents a paged message
-
Constructor Summary
ConstructorsConstructorDescriptionPagedMessageImpl(int storedSize, StorageManager storageManager) PagedMessageImpl(Message message, long[] queueIDs) PagedMessageImpl(Message message, long[] queueIDs, long transactionID) -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(ActiveMQBuffer buffer) voidencode(ActiveMQBuffer buffer) intintlonglongThis is the size of the message when persisted on disk and is used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body sizelong[]The queues that were routed during pagingintThis returns how much the PagedMessage used, or it's going to use from storage.longvoidinitMessage(StorageManager storage) static booleanisLargeMessage(ActiveMQBuffer buffer) This method won't move theActiveMQBuffer.readerIndex()ofbuffer.setMessageNumber(int messageNr) setPageNumber(long pageNr) toString()
-
Constructor Details
-
PagedMessageImpl
-
PagedMessageImpl
-
PagedMessageImpl
-
-
Method Details
-
getPageNumber
public long getPageNumber()- Specified by:
getPageNumberin interfacePagedMessage
-
setPageNumber
- Specified by:
setPageNumberin interfacePagedMessage
-
getMessageNumber
public int getMessageNumber()- Specified by:
getMessageNumberin interfacePagedMessage
-
setMessageNumber
- Specified by:
setMessageNumberin interfacePagedMessage
-
getStoredSize
public int getStoredSize()Description copied from interface:PagedMessageThis returns how much the PagedMessage used, or it's going to use from storage. We can't calculate the encodeSize as some persisters don't guarantee to re-store the data at the same amount of bytes it used. In some cases it may need to add headers in AMQP or extra data that may affect the outcome of getEncodeSize()- Specified by:
getStoredSizein interfacePagedMessage
-
getMessage
- Specified by:
getMessagein interfacePagedMessage
-
newPositionObject
- Specified by:
newPositionObjectin interfacePagedMessage
-
initMessage
- Specified by:
initMessagein interfacePagedMessage
-
getTransactionID
public long getTransactionID()- Specified by:
getTransactionIDin interfacePagedMessage
-
getQueueIDs
public long[] getQueueIDs()Description copied from interface:PagedMessageThe queues that were routed during paging- Specified by:
getQueueIDsin interfacePagedMessage
-
isLargeMessage
This method won't move theActiveMQBuffer.readerIndex()ofbuffer. -
decode
- Specified by:
decodein interfaceEncodingSupport
-
encode
- Specified by:
encodein interfaceEncodingSupport
-
getEncodeSize
public int getEncodeSize()- Specified by:
getEncodeSizein interfaceEncodingSupport
-
toString
-
getPersistentSize
Description copied from interface:PagedMessageThis is the size of the message when persisted on disk and is used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body size- Specified by:
getPersistentSizein interfacePagedMessage- Throws:
ActiveMQException
-