Class PageCursorProviderImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.paging.cursor.impl.PageCursorProviderImpl
-
- All Implemented Interfaces:
PageCursorProvider
public class PageCursorProviderImpl extends Object implements PageCursorProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancleanupEnabledprotected booleancountersRebuiltprotected PagingStorepagingStoreprotected AtomicIntegerscheduledCleanupAs an optimization, avoid subsequent schedules as they are unnecessaryprotected StorageManagerstorageManager
-
Constructor Summary
Constructors Constructor Description PageCursorProviderImpl(PagingStore pagingStore, StorageManager storageManager)
-
Method Summary
-
-
-
Field Detail
-
scheduledCleanup
protected final AtomicInteger scheduledCleanup
As an optimization, avoid subsequent schedules as they are unnecessary
-
cleanupEnabled
protected volatile boolean cleanupEnabled
-
countersRebuilt
protected volatile boolean countersRebuilt
-
pagingStore
protected final PagingStore pagingStore
-
storageManager
protected final StorageManager storageManager
-
-
Constructor Detail
-
PageCursorProviderImpl
public PageCursorProviderImpl(PagingStore pagingStore, StorageManager storageManager)
-
-
Method Detail
-
createSubscription
public PageSubscription createSubscription(long cursorID, Filter filter, boolean persistent)
- Specified by:
createSubscriptionin interfacePageCursorProvider
-
getSubscription
public PageSubscription getSubscription(long cursorID)
- Specified by:
getSubscriptionin interfacePageCursorProvider- Parameters:
cursorID- The cursorID should be the same as the queueId associated for persistence- Returns:
-
forEachSubscription
public void forEachSubscription(Consumer<PageSubscription> consumer)
- Specified by:
forEachSubscriptionin interfacePageCursorProvider
-
newReference
public PagedReference newReference(PagedMessage msg, PageSubscription subscription)
- Specified by:
newReferencein interfacePageCursorProvider
-
processReload
public void processReload() throws Exception- Specified by:
processReloadin interfacePageCursorProvider- Throws:
Exception
-
stop
public void stop()
- Specified by:
stopin interfacePageCursorProvider
-
counterSnapshot
public void counterSnapshot()
- Specified by:
counterSnapshotin interfacePageCursorProvider
-
flushExecutors
public void flushExecutors()
- Specified by:
flushExecutorsin interfacePageCursorProvider
-
close
public void close(PageSubscription cursor)
- Specified by:
closein interfacePageCursorProvider
-
scheduleCleanup
public Future<Boolean> scheduleCleanup()
- Specified by:
scheduleCleanupin interfacePageCursorProvider
-
onPageModeCleared
public void onPageModeCleared()
Delete everything associated with any queue on this address. This is to be called when the address is about to be released from paging. Hence the PagingStore will be holding a write lock, meaning no messages are going to be paged at this time. So, we shouldn't lock anything after this method, to avoid dead locks between the writeLock and any synchronization with the CursorProvider.- Specified by:
onPageModeClearedin interfacePageCursorProvider
-
disableCleanup
public void disableCleanup()
- Specified by:
disableCleanupin interfacePageCursorProvider
-
resumeCleanup
public void resumeCleanup()
- Specified by:
resumeCleanupin interfacePageCursorProvider
-
cleanup
protected void cleanup()
-
cleanupComplete
protected void cleanupComplete(ArrayList<PageSubscription> cursorList) throws Exception
- Throws:
Exception
-
storeBookmark
protected void storeBookmark(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
- Parameters:
cursorList-currentPage-- Throws:
Exception
-
counterRebuildStarted
public void counterRebuildStarted()
- Specified by:
counterRebuildStartedin interfacePageCursorProvider
-
counterRebuildDone
public void counterRebuildDone()
- Specified by:
counterRebuildDonein interfacePageCursorProvider
-
-