Class Page
- java.lang.Object
-
- org.apache.activemq.artemis.core.paging.impl.Page
-
- All Implemented Interfaces:
Comparable<Page>
public final class Page extends Object implements Comparable<Page>
-
-
Field Summary
Fields Modifier and Type Field Description static intSIZE_RECORD
-
Constructor Summary
Constructors Constructor Description Page(SimpleString storeName, StorageManager storageManager, SequentialFileFactory factory, SequentialFile file, int pageId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPendingCounter(PageSubscriptionCounter pageSubscriptionCounter)This will indicate a page that will need to be called on cleanup when the page has been closed and confirmedvoidclose(boolean sendEvent)voidclose(boolean sendEvent, boolean waitSync)sendEvent means it's a close happening from a major event such moveNext.intcompareTo(Page otherPage)booleandelete(PagedMessage[] messages)booleanequals(Object obj)SequentialFilegetFile()LivePageCachegetLiveCache()intgetNumberOfMessages()intgetPageId()intgetSize()inthashCode()booleanisLive()voidopen(boolean createFile)List<PagedMessage>read()List<PagedMessage>read(StorageManager storage)List<PagedMessage>read(StorageManager storage, boolean onlyLargeMessages)PagedMessagereadMessage(int startOffset, int startMessageNumber, int targetMessageNumber)voidsetLiveCache(LivePageCache pageCache)voidsync()StringtoString()voidwrite(PagedMessage message)voidwriteDirect(PagedMessage message)This write will not interact back with the storage manager.
-
-
-
Field Detail
-
SIZE_RECORD
public static final int SIZE_RECORD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Page
public Page(SimpleString storeName, StorageManager storageManager, SequentialFileFactory factory, SequentialFile file, int pageId) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getPageId
public int getPageId()
-
setLiveCache
public void setLiveCache(LivePageCache pageCache)
-
getLiveCache
public LivePageCache getLiveCache()
-
readMessage
public PagedMessage readMessage(int startOffset, int startMessageNumber, int targetMessageNumber) throws Exception
- Throws:
Exception
-
read
public List<PagedMessage> read() throws Exception
- Throws:
Exception
-
read
public List<PagedMessage> read(StorageManager storage) throws Exception
- Throws:
Exception
-
read
public List<PagedMessage> read(StorageManager storage, boolean onlyLargeMessages) throws Exception
- Throws:
Exception
-
write
public void write(PagedMessage message) throws Exception
- Throws:
Exception
-
writeDirect
public void writeDirect(PagedMessage message) throws Exception
This write will not interact back with the storage manager. To avoid ping pongs with Journal retaining events and any other stuff.- Throws:
Exception
-
close
public void close(boolean sendEvent, boolean waitSync) throws ExceptionsendEvent means it's a close happening from a major event such moveNext. While reading the cache we don't need (and shouldn't inform the backup- Throws:
Exception
-
isLive
public boolean isLive()
-
delete
public boolean delete(PagedMessage[] messages) throws Exception
- Throws:
Exception
-
getNumberOfMessages
public int getNumberOfMessages()
-
getSize
public int getSize()
-
compareTo
public int compareTo(Page otherPage)
- Specified by:
compareToin interfaceComparable<Page>
-
getFile
public SequentialFile getFile()
-
addPendingCounter
public void addPendingCounter(PageSubscriptionCounter pageSubscriptionCounter)
This will indicate a page that will need to be called on cleanup when the page has been closed and confirmed- Parameters:
pageSubscriptionCounter-
-
-