Class PagedMessageImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.paging.impl.PagedMessageImpl
-
- All Implemented Interfaces:
EncodingSupport,PagedMessage
public class PagedMessageImpl extends Object implements PagedMessage
This class represents a paged message
-
-
Constructor Summary
Constructors Constructor Description PagedMessageImpl(int storedSize, StorageManager storageManager)PagedMessageImpl(Message message, long[] queueIDs)PagedMessageImpl(Message message, long[] queueIDs, long transactionID)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecode(ActiveMQBuffer buffer)voidencode(ActiveMQBuffer buffer)intgetEncodeSize()MessagegetMessage()intgetMessageNumber()longgetPageNumber()longgetPersistentSize()This 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[]getQueueIDs()The queues that were routed during pagingintgetStoredSize()This returns how much the PagedMessage used, or it's going to use from storage.longgetTransactionID()voidinitMessage(StorageManager storage)static booleanisLargeMessage(ActiveMQBuffer buffer)This method won't move theActiveMQBuffer.readerIndex()ofbuffer.PagePositionnewPositionObject()PagedMessageImplsetMessageNumber(int messageNr)PagedMessageImplsetPageNumber(long pageNr)StringtoString()
-
-
-
Constructor Detail
-
PagedMessageImpl
public PagedMessageImpl(Message message, long[] queueIDs, long transactionID)
-
PagedMessageImpl
public PagedMessageImpl(Message message, long[] queueIDs)
-
PagedMessageImpl
public PagedMessageImpl(int storedSize, StorageManager storageManager)
-
-
Method Detail
-
getPageNumber
public long getPageNumber()
- Specified by:
getPageNumberin interfacePagedMessage
-
setPageNumber
public PagedMessageImpl setPageNumber(long pageNr)
- Specified by:
setPageNumberin interfacePagedMessage
-
getMessageNumber
public int getMessageNumber()
- Specified by:
getMessageNumberin interfacePagedMessage
-
setMessageNumber
public PagedMessageImpl setMessageNumber(int messageNr)
- 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
public Message getMessage()
- Specified by:
getMessagein interfacePagedMessage
-
newPositionObject
public PagePosition newPositionObject()
- Specified by:
newPositionObjectin interfacePagedMessage
-
initMessage
public void initMessage(StorageManager storage)
- 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
public static boolean isLargeMessage(ActiveMQBuffer buffer)
This method won't move theActiveMQBuffer.readerIndex()ofbuffer.
-
decode
public void decode(ActiveMQBuffer buffer)
- Specified by:
decodein interfaceEncodingSupport
-
encode
public void encode(ActiveMQBuffer buffer)
- Specified by:
encodein interfaceEncodingSupport
-
getEncodeSize
public int getEncodeSize()
- Specified by:
getEncodeSizein interfaceEncodingSupport
-
getPersistentSize
public long getPersistentSize() throws ActiveMQExceptionDescription 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- Returns:
- Throws:
ActiveMQException
-
-