public class PagingStoreImpl extends Object implements PagingStore
PagingStore| Constructor and Description |
|---|
PagingStoreImpl(SimpleString address,
ScheduledExecutorService scheduledExecutor,
long syncTimeout,
PagingManager pagingManager,
StorageManager storageManager,
SequentialFileFactory fileFactory,
PagingStoreFactory storeFactory,
SimpleString storeName,
AddressSettings addressSettings,
Executor executor,
boolean syncNonTransactional) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSize(int size) |
void |
applySetting(AddressSettings addressSettings) |
boolean |
checkMemory(Runnable runWhenAvailable) |
boolean |
checkPageFileExists(int pageNumber) |
boolean |
checkReleasedMemory()
It will return true if the destination is leaving blocking.
|
boolean |
checkReleaseMemory(boolean globalOversized,
long newSize) |
Page |
createPage(int pageNumber) |
Page |
depage()
Returns a Page out of the Page System without reading it.
|
void |
disableCleanup()
This method will disable cleanup of pages.
|
void |
enableCleanup()
This method will re-enable cleanup of pages.
|
void |
flushExecutors()
This is used mostly by tests.
|
void |
forceAnotherPage() |
SimpleString |
getAddress() |
AddressFullMessagePolicy |
getAddressFullMessagePolicy() |
long |
getAddressSize() |
Collection<Integer> |
getCurrentIds()
Files to synchronize with a remote backup.
|
Page |
getCurrentPage() |
int |
getCurrentWritingPage()
Returns the page id of the current page in which the system is writing files.
|
PageCursorProvider |
getCursorProvider() |
long |
getFirstPage() |
File |
getFolder() |
long |
getMaxSize() |
int |
getNumberOfPages() |
long |
getPageSizeBytes() |
PagingManager |
getPagingManager() |
SimpleString |
getStoreName() |
void |
ioSync()
Performs a real sync on the current IO file.
|
boolean |
isFull() |
boolean |
isPaging() |
boolean |
isRejectingMessages() |
boolean |
isStarted() |
boolean |
lock(long timeout)
Write lock the PagingStore.
|
boolean |
page(ServerMessage message,
Transaction tx,
RouteContextList listCtx,
ReentrantReadWriteLock.ReadLock managerLock)
Write message to page if we are paging.
|
void |
processReload() |
void |
sendPages(ReplicationManager replicator,
Collection<Integer> pageIds)
Sends the pages with given IDs to the
ReplicationManager. |
void |
start() |
boolean |
startPaging() |
void |
stop() |
void |
stopPaging() |
void |
sync()
Schedules sync to the file storage.
|
String |
toString() |
void |
unlock()
Releases locks acquired with
PagingStore.lock(long). |
public PagingStoreImpl(SimpleString address, ScheduledExecutorService scheduledExecutor, long syncTimeout, PagingManager pagingManager, StorageManager storageManager, SequentialFileFactory fileFactory, PagingStoreFactory storeFactory, SimpleString storeName, AddressSettings addressSettings, Executor executor, boolean syncNonTransactional)
public void applySetting(AddressSettings addressSettings)
applySetting in interface PagingStoreaddressSettings - public boolean lock(long timeout)
PagingStorelock in interface PagingStoretimeout - milliseconds to wait for the lock. If value is -1 then wait
indefinitely.true if the lock was obtained, false otherwisepublic void unlock()
PagingStorePagingStore.lock(long).unlock in interface PagingStorepublic PageCursorProvider getCursorProvider()
getCursorProvider in interface PagingStorepublic long getFirstPage()
getFirstPage in interface PagingStorepublic SimpleString getAddress()
getAddress in interface PagingStorepublic long getAddressSize()
getAddressSize in interface PagingStorepublic long getMaxSize()
getMaxSize in interface PagingStorepublic AddressFullMessagePolicy getAddressFullMessagePolicy()
getAddressFullMessagePolicy in interface PagingStorepublic long getPageSizeBytes()
getPageSizeBytes in interface PagingStorepublic File getFolder()
getFolder in interface PagingStorepublic boolean isPaging()
isPaging in interface PagingStorepublic int getNumberOfPages()
getNumberOfPages in interface PagingStorepublic int getCurrentWritingPage()
PagingStoregetCurrentWritingPage in interface PagingStorepublic SimpleString getStoreName()
getStoreName in interface PagingStorepublic void sync()
throws Exception
PagingStoresync in interface PagingStoreExceptionpublic void ioSync()
throws Exception
PagingStoreioSync in interface PagingStoreExceptionpublic void processReload()
throws Exception
processReload in interface PagingStoreExceptionpublic PagingManager getPagingManager()
getPagingManager in interface PagingStorepublic boolean isStarted()
isStarted in interface ActiveMQComponentpublic void stop()
throws Exception
stop in interface ActiveMQComponentExceptionpublic void flushExecutors()
PagingStoreflushExecutors in interface PagingStorepublic void start()
throws Exception
start in interface ActiveMQComponentExceptionpublic void stopPaging()
stopPaging in interface PagingStorepublic boolean startPaging()
startPaging in interface PagingStorepublic Page getCurrentPage()
getCurrentPage in interface PagingStorepublic boolean checkPageFileExists(int pageNumber)
checkPageFileExists in interface PagingStorepublic Page createPage(int pageNumber) throws Exception
createPage in interface PagingStoreExceptionpublic void forceAnotherPage()
throws Exception
forceAnotherPage in interface PagingStoreExceptionpublic Page depage() throws Exception
The method calling this method will remove the page and will start reading it outside of any locks. This method could also replace the current file by a new file, and that process is done through acquiring a writeLock on currentPageLock.
Observation: This method is used internally as part of the regular depage process, but externally is used only on tests, and that's why this method is part of the Testable Interface
depage in interface PagingStoreException - Note: This should still be part of the interface, even though ActiveMQ Artemis only uses through thepublic boolean checkMemory(Runnable runWhenAvailable)
checkMemory in interface PagingStorepublic void addSize(int size)
addSize in interface PagingStorepublic boolean checkReleasedMemory()
PagingStorecheckReleasedMemory in interface PagingStorepublic boolean checkReleaseMemory(boolean globalOversized,
long newSize)
public boolean page(ServerMessage message, Transaction tx, RouteContextList listCtx, ReentrantReadWriteLock.ReadLock managerLock) throws Exception
PagingStorepage in interface PagingStoremanagerLock - a read lock from the storage manager. This is an encapsulation violation made
to keep the code less complex. If give null the method will throw a
NullPointerExceptiontrue if we are paging and have handled the data, false if the data
needs to be sent to the journalNullPointerException - if readLock is nullExceptionpublic void disableCleanup()
disableCleanup in interface PagingStorepublic void enableCleanup()
enableCleanup in interface PagingStorepublic boolean isFull()
isFull in interface PagingStorepublic boolean isRejectingMessages()
isRejectingMessages in interface PagingStorepublic Collection<Integer> getCurrentIds() throws Exception
PagingStoregetCurrentIds in interface PagingStoreExceptionpublic void sendPages(ReplicationManager replicator, Collection<Integer> pageIds) throws Exception
PagingStoreReplicationManager.
Sending is done here to avoid exposing the internal SequentialFiles.
sendPages in interface PagingStoreExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.