public class PageCursorProviderImpl extends Object implements PageCursorProvider
Modifier and Type | Field and Description |
---|---|
protected boolean |
cleanupEnabled |
protected PagingStore |
pagingStore |
protected AtomicInteger |
scheduledCleanup
As an optimization, avoid subsequent schedules as they are unnecessary
|
protected StorageManager |
storageManager |
Constructor and Description |
---|
PageCursorProviderImpl(PagingStore pagingStore,
StorageManager storageManager,
Executor executor,
int maxCacheSize) |
Modifier and Type | Method and Description |
---|---|
void |
addPageCache(PageCache cache) |
void |
cleanup()
Perform the cleanup at the caller's thread (for startup and recovery)
|
protected void |
cleanupComplete(ArrayList<PageSubscription> cursorList) |
void |
clearCache()
Used on tests, to simulate a scenario where the VM cleared space
|
void |
close(PageSubscription cursor) |
protected org.apache.activemq.artemis.core.paging.cursor.impl.PageCacheImpl |
createPageCache(long pageId) |
PageSubscription |
createSubscription(long cursorID,
Filter filter,
boolean persistent) |
void |
disableCleanup() |
protected void |
finishCleanup(ArrayList<Page> depagedPages) |
void |
flushExecutors() |
int |
getCacheSize() |
PagedMessage |
getMessage(PagePosition pos) |
PageCache |
getPageCache(long pageId) |
PageSubscription |
getSubscription(long cursorID) |
PagedReference |
newReference(PagePosition pos,
PagedMessage msg,
PageSubscription subscription) |
protected void |
onDeletePage(Page deletedPage) |
void |
onPageModeCleared()
Delete everything associated with any queue on this address.
|
void |
printDebug() |
void |
processReload() |
void |
resumeCleanup() |
void |
scheduleCleanup() |
void |
setCacheMaxSize(int size) |
void |
stop() |
protected void |
storeBookmark(ArrayList<PageSubscription> cursorList,
Page currentPage) |
String |
toString() |
protected final AtomicInteger scheduledCleanup
protected volatile boolean cleanupEnabled
protected final PagingStore pagingStore
protected final StorageManager storageManager
public PageCursorProviderImpl(PagingStore pagingStore, StorageManager storageManager, Executor executor, int maxCacheSize)
public PageSubscription createSubscription(long cursorID, Filter filter, boolean persistent)
createSubscription
in interface PageCursorProvider
public PageSubscription getSubscription(long cursorID)
getSubscription
in interface PageCursorProvider
cursorID
- The cursorID should be the same as the queueId associated for persistencepublic PagedMessage getMessage(PagePosition pos)
getMessage
in interface PageCursorProvider
public PagedReference newReference(PagePosition pos, PagedMessage msg, PageSubscription subscription)
newReference
in interface PageCursorProvider
public PageCache getPageCache(long pageId)
getPageCache
in interface PageCursorProvider
public void addPageCache(PageCache cache)
addPageCache
in interface PageCursorProvider
public void setCacheMaxSize(int size)
setCacheMaxSize
in interface PageCursorProvider
public int getCacheSize()
getCacheSize
in interface PageCursorProvider
public void clearCache()
PageCursorProvider
clearCache
in interface PageCursorProvider
public void processReload() throws Exception
processReload
in interface PageCursorProvider
Exception
public void stop()
stop
in interface PageCursorProvider
public void flushExecutors()
flushExecutors
in interface PageCursorProvider
public void close(PageSubscription cursor)
close
in interface PageCursorProvider
public void scheduleCleanup()
scheduleCleanup
in interface PageCursorProvider
public void onPageModeCleared()
onPageModeCleared
in interface PageCursorProvider
public void disableCleanup()
disableCleanup
in interface PageCursorProvider
public void resumeCleanup()
resumeCleanup
in interface PageCursorProvider
public void cleanup()
PageCursorProvider
cleanup
in interface PageCursorProvider
protected void cleanupComplete(ArrayList<PageSubscription> cursorList) throws Exception
Exception
protected void storeBookmark(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
cursorList
- currentPage
- Exception
public void printDebug()
printDebug
in interface PageCursorProvider
Copyright © 2017 JBoss by Red Hat. All rights reserved.