Class PageSubscriptionImpl
java.lang.Object
org.apache.activemq.artemis.core.paging.cursor.impl.PageSubscriptionImpl
- All Implemented Interfaces:
PageSubscription
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThis will hold information about the pending ACKs towards a page. -
Method Summary
Modifier and TypeMethodDescriptionvoidack(PagedReference reference) voidackTx(Transaction tx, PagedReference reference, boolean fromDelivery) voidaddPendingDelivery(PagedMessage pagedMessage) voidbookmark(PagePosition position) voidcleanupEntries(boolean completeDelete) It will cleanup all the records for completed pagesvoidconfirmPosition(PagePosition position) voidconfirmPosition(Transaction tx, PagePosition position, boolean fromDelivery) booleancontains(PagedReference ref) voidSave a snapshot of the current counter value in the journalvoiddestroy()All the data associated with the cursor should go away herevoidvoidvoidforEachConsumedPage(Consumer<ConsumedPage> pageConsumer) longReturns the first page in use or MAX_LONG if none is in use.longgetId()longgetPageInfo(long pageNr) longgetQueue()for testsbooleanisAcked(PagedMessage pagedMessage) booleanisComplete(long page) booleanbooleanisPaging()Used as a delegate method toPagingStore.isPaging()booleaniterator()iterator(boolean browsing) voidlateDeliveryRollback(PagePosition position) locatePageInfo(long pageNr) voidnotEmpty()This is a callback to inform the PageSubscription that something was routed, so the empty flag can be clearedvoidonDeletePage(Page deletedPage) voidvoidpositionIgnored(PagePosition position) To be called when the cursor decided to ignore a position.voidvoidprintDebug(String msg) voidqueryMessage(PagePosition pos) To be used to requery the referencevoidredeliver(PageIterator iterator, PagedReference pagedReference) voidreloadACK(PagePosition position) Theres no need to synchronize this method as it's only called from journal load on startupbooleanreloadPageCompletion(PagePosition position) A page marked as complete will be ignored until it's cleared.voidreloadPageInfo(long pageNr) voidreloadPreparedACK(Transaction tx, PagePosition position) To be used to avoid a redelivery of a prepared ACK after loadvoidremovePendingDelivery(PagedMessage pagedMessage) voidvoidvoidstop()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.core.paging.cursor.PageSubscription
ackTx
-
Method Details
-
getScheduledCleanupCount
for tests -
getPagingStore
- Specified by:
getPagingStorein interfacePageSubscription
-
getQueue
- Specified by:
getQueuein interfacePageSubscription
-
isPaging
public boolean isPaging()Description copied from interface:PageSubscriptionUsed as a delegate method toPagingStore.isPaging()- Specified by:
isPagingin interfacePageSubscription
-
setQueue
- Specified by:
setQueuein interfacePageSubscription
-
disableAutoCleanup
public void disableAutoCleanup()- Specified by:
disableAutoCleanupin interfacePageSubscription
-
enableAutoCleanup
public void enableAutoCleanup()- Specified by:
enableAutoCleanupin interfacePageSubscription
-
getProvider
-
notEmpty
public void notEmpty()Description copied from interface:PageSubscriptionThis is a callback to inform the PageSubscription that something was routed, so the empty flag can be cleared- Specified by:
notEmptyin interfacePageSubscription
-
bookmark
- Specified by:
bookmarkin interfacePageSubscription- Throws:
Exception
-
getMessageCount
public long getMessageCount()- Specified by:
getMessageCountin interfacePageSubscription
-
isCounterPending
public boolean isCounterPending()- Specified by:
isCounterPendingin interfacePageSubscription
-
getPersistentSize
public long getPersistentSize()- Specified by:
getPersistentSizein interfacePageSubscription
-
getCounter
- Specified by:
getCounterin interfacePageSubscription
-
reloadPageCompletion
A page marked as complete will be ignored until it's cleared.Usually paging is a stream of messages but in certain scenarios (such as a pending prepared TX) we may have big holes on the page streaming, and we will need to ignore such pages on the cursor/subscription.
- Specified by:
reloadPageCompletionin interfacePageSubscription- Throws:
Exception
-
scheduleCleanupCheck
public void scheduleCleanupCheck()- Specified by:
scheduleCleanupCheckin interfacePageSubscription
-
onPageModeCleared
- Specified by:
onPageModeClearedin interfacePageSubscription- Throws:
Exception
-
cleanupEntries
It will cleanup all the records for completed pages- Specified by:
cleanupEntriesin interfacePageSubscription- Throws:
Exception
-
toString
-
iterator
- Specified by:
iteratorin interfacePageSubscription
-
iterator
- Specified by:
iteratorin interfacePageSubscription
-
confirmPosition
public void confirmPosition(Transaction tx, PagePosition position, boolean fromDelivery) throws Exception - Specified by:
confirmPositionin interfacePageSubscription- Throws:
Exception
-
ackTx
- Specified by:
ackTxin interfacePageSubscription- Throws:
Exception
-
ack
- Specified by:
ackin interfacePageSubscription- Throws:
Exception
-
contains
- Specified by:
containsin interfacePageSubscription- Throws:
Exception
-
isAcked
- Specified by:
isAckedin interfacePageSubscription
-
confirmPosition
- Specified by:
confirmPositionin interfacePageSubscription- Throws:
Exception
-
getFirstPage
public long getFirstPage()Description copied from interface:PageSubscriptionReturns the first page in use or MAX_LONG if none is in use.- Specified by:
getFirstPagein interfacePageSubscription- Returns:
- the first page in use or MAX_LONG if none is in use
-
addPendingDelivery
- Specified by:
addPendingDeliveryin interfacePageSubscription
-
removePendingDelivery
- Specified by:
removePendingDeliveryin interfacePageSubscription
-
redeliver
- Specified by:
redeliverin interfacePageSubscription
-
queryMessage
Description copied from interface:PageSubscriptionTo be used to requery the reference- Specified by:
queryMessagein interfacePageSubscription
-
reloadACK
Theres no need to synchronize this method as it's only called from journal load on startup- Specified by:
reloadACKin interfacePageSubscription
-
reloadPreparedACK
Description copied from interface:PageSubscriptionTo be used to avoid a redelivery of a prepared ACK after load- Specified by:
reloadPreparedACKin interfacePageSubscription
-
positionIgnored
Description copied from interface:PageSubscriptionTo be called when the cursor decided to ignore a position.- Specified by:
positionIgnoredin interfacePageSubscription
-
lateDeliveryRollback
- Specified by:
lateDeliveryRollbackin interfacePageSubscription
-
forEachConsumedPage
- Specified by:
forEachConsumedPagein interfacePageSubscription
-
isComplete
public boolean isComplete(long page) - Specified by:
isCompletein interfacePageSubscription
-
destroy
All the data associated with the cursor should go away here- Specified by:
destroyin interfacePageSubscription- Throws:
Exception
-
getId
public long getId()- Specified by:
getIdin interfacePageSubscription
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfacePageSubscription
-
processReload
- Specified by:
processReloadin interfacePageSubscription- Throws:
Exception
-
stop
public void stop()- Specified by:
stopin interfacePageSubscription
-
counterSnapshot
public void counterSnapshot()Description copied from interface:PageSubscriptionSave a snapshot of the current counter value in the journal- Specified by:
counterSnapshotin interfacePageSubscription
-
printDebug
public void printDebug()- Specified by:
printDebugin interfacePageSubscription
-
printDebug
-
onDeletePage
- Specified by:
onDeletePagein interfacePageSubscription- Throws:
Exception
-
reloadPageInfo
public void reloadPageInfo(long pageNr) - Specified by:
reloadPageInfoin interfacePageSubscription
-
locatePageInfo
- Specified by:
locatePageInfoin interfacePageSubscription
-
getPageInfo
-