Interface PagingManager
-
- All Superinterfaces:
ActiveMQComponent,HierarchicalRepositoryChangeListener
- All Known Implementing Classes:
PagingManagerImpl
public interface PagingManager extends ActiveMQComponent, HierarchicalRepositoryChangeListener
+--------------+ 1 +----------------+ N +--------------+ N +--------+ 1 +-------------------+ |
PostOffice|-------> |PagingManager|-------> |PagingStore| ------> |Page| ------> |SequentialFile| +--------------+ +----------------+ +--------------+ +--------+ +-------------------+ | 1 ^ | | | | | | 1 | N +----------+ +------------> |Address| +----------+
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddBlockedStore(PagingStore store)default PagingManageraddSize(int size)An utility method to call addSize(size, false); this is a good fit for an IntConsumer.PagingManageraddSize(int size, boolean sizeOnly)Add size at the global count level.default PagingManageraddSizeOnly(int size)An utility method to call addSize(size, true); this is a good fit for an IntConsumer.voidaddTransaction(PageTransactionInfo pageTransaction)Point to inform/restoring Transactions used when the messages were added into pagingvoidcheckMemory(Runnable runWhenAvailable)Use this when you have no refernce of an address.default voidcheckStorage(Runnable runWhenAvailable)Use this when you have no refernce of an address.voiddeletePageStore(SimpleString storeName)voiddisableCleanup()longgetDiskTotalSpace()longgetDiskUsableSpace()default longgetGlobalMessages()default longgetGlobalSize()default longgetMaxMessages()default longgetMaxSize()PagingStoregetPageStore(SimpleString address)Returns the PageStore associated with the address.SimpleString[]getStoreNames()PageTransactionInfogetTransaction(long transactionID)Point to inform/restoring Transactions used when the messages were added into pagingMap<Long,PageTransactionInfo>getTransactions()voidinjectMonitor(FileStoreMonitor monitor)booleanisDiskFull()booleanisGlobalFull()booleanisUsingGlobalSize()voidlock()Lock the manager.voidprocessReload()voidreloadStores()Reload previously created PagingStores into memoryvoidremoveTransaction(long transactionID)voidresumeCleanup()voidunlock()Unlock the manager.-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop, isStarted, start, stop
-
Methods inherited from interface org.apache.activemq.artemis.core.settings.HierarchicalRepositoryChangeListener
onChange
-
-
-
-
Method Detail
-
getPageStore
PagingStore getPageStore(SimpleString address) throws Exception
Returns the PageStore associated with the address. A new page store is created if necessary.- Throws:
Exception
-
addTransaction
void addTransaction(PageTransactionInfo pageTransaction)
Point to inform/restoring Transactions used when the messages were added into paging
-
getTransaction
PageTransactionInfo getTransaction(long transactionID)
Point to inform/restoring Transactions used when the messages were added into paging
-
removeTransaction
void removeTransaction(long transactionID)
- Parameters:
transactionID-
-
getTransactions
Map<Long,PageTransactionInfo> getTransactions()
-
reloadStores
void reloadStores() throws ExceptionReload previously created PagingStores into memory- Throws:
Exception
-
getStoreNames
SimpleString[] getStoreNames()
-
deletePageStore
void deletePageStore(SimpleString storeName) throws Exception
- Throws:
Exception
-
disableCleanup
void disableCleanup()
-
resumeCleanup
void resumeCleanup()
-
addBlockedStore
void addBlockedStore(PagingStore store)
-
injectMonitor
void injectMonitor(FileStoreMonitor monitor) throws Exception
- Throws:
Exception
-
lock
void lock()
Lock the manager. This method should not be called during normal PagingManager usage.
-
unlock
void unlock()
Unlock the manager.- See Also:
lock()
-
addSize
PagingManager addSize(int size, boolean sizeOnly)
Add size at the global count level. if sizeOnly = true, only the size portion is updated. If false both the counter for bytes and number of messages is updated.
-
addSize
default PagingManager addSize(int size)
An utility method to call addSize(size, false); this is a good fit for an IntConsumer.
-
addSizeOnly
default PagingManager addSizeOnly(int size)
An utility method to call addSize(size, true); this is a good fit for an IntConsumer.
-
isUsingGlobalSize
boolean isUsingGlobalSize()
-
isGlobalFull
boolean isGlobalFull()
-
isDiskFull
boolean isDiskFull()
-
getDiskUsableSpace
long getDiskUsableSpace()
-
getDiskTotalSpace
long getDiskTotalSpace()
-
getGlobalSize
default long getGlobalSize()
-
getGlobalMessages
default long getGlobalMessages()
-
checkMemory
void checkMemory(Runnable runWhenAvailable)
Use this when you have no refernce of an address. (anonymous AMQP Producers for example)- Parameters:
runWhenAvailable-
-
checkStorage
default void checkStorage(Runnable runWhenAvailable)
Use this when you have no refernce of an address. (anonymous AMQP Producers for example)- Parameters:
runWhenAvailable-
-
getMaxSize
default long getMaxSize()
-
getMaxMessages
default long getMaxMessages()
-
-