Class PagingManagerImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl
-
- All Implemented Interfaces:
PagingManager,ActiveMQComponent,HierarchicalRepositoryChangeListener
public final class PagingManagerImpl extends Object implements PagingManager
-
-
Constructor Summary
Constructors Constructor Description PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository)PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, long maxSize, long maxMessages, SimpleString managementAddress)PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, SimpleString managementAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBlockedStore(PagingStore store)PagingManagerImpladdSize(int size, boolean sizeOnly)Add size at the global count level.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.protected voidcheckMemoryRelease()voidcheckStorage(Runnable runWhenAvailable)Use this when you have no refernce of an address.voidcounterSnapshot()voiddeletePageStore(SimpleString storeName)voiddisableCleanup()voidexecute(Runnable run)Execute a runnable inside the PagingManager's executorvoidforEachTransaction(BiConsumer<Long,PageTransactionInfo> transactionConsumer)longgetDiskTotalSpace()longgetDiskUsableSpace()longgetGlobalMessages()longgetGlobalSize()longgetMaxMessages()longgetMaxSize()PagingStoregetPageStore(SimpleString rawStoreName)This method creates a new store if not exist.PagingStoreFactorygetPagingStoreFactory()SimpleString[]getStoreNames()PageTransactionInfogetTransaction(long id)Point to inform/restoring Transactions used when the messages were added into pagingMap<Long,PageTransactionInfo>getTransactions()voidinjectMonitor(FileStoreMonitor monitor)booleanisDiskFull()booleanisGlobalFull()booleanisStarted()booleanisUsingGlobalSize()voidlock()Lock the manager.voidonChange()voidprocessReload()Future<Object>rebuildCounters(Set<Long> storedLargeMessages)Rebuilds all page counters for destinations that are paging in the background.voidreloadStores()Reload previously created PagingStores into memoryvoidremoveTransaction(long id)voidreplacePageStoreFactory(PagingStoreFactory factory)voidresumeCleanup()protected voidsetDiskFull(boolean diskFull)voidstart()voidstop()voidunlock()Unlock the manager.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Methods inherited from interface org.apache.activemq.artemis.core.paging.PagingManager
addSize, addSizeOnly
-
-
-
-
Constructor Detail
-
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, long maxSize, long maxMessages, SimpleString managementAddress)
-
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository)
-
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, SimpleString managementAddress)
-
-
Method Detail
-
replacePageStoreFactory
public void replacePageStoreFactory(PagingStoreFactory factory)
-
getPagingStoreFactory
public PagingStoreFactory getPagingStoreFactory()
-
getMaxSize
public long getMaxSize()
- Specified by:
getMaxSizein interfacePagingManager
-
getMaxMessages
public long getMaxMessages()
- Specified by:
getMaxMessagesin interfacePagingManager
-
addBlockedStore
public void addBlockedStore(PagingStore store)
- Specified by:
addBlockedStorein interfacePagingManager
-
onChange
public void onChange()
- Specified by:
onChangein interfaceHierarchicalRepositoryChangeListener
-
addSize
public PagingManagerImpl addSize(int size, boolean sizeOnly)
Description copied from interface:PagingManagerAdd 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.- Specified by:
addSizein interfacePagingManager
-
getGlobalSize
public long getGlobalSize()
- Specified by:
getGlobalSizein interfacePagingManager
-
getGlobalMessages
public long getGlobalMessages()
- Specified by:
getGlobalMessagesin interfacePagingManager
-
checkMemoryRelease
protected void checkMemoryRelease()
-
execute
public void execute(Runnable run)
Description copied from interface:PagingManagerExecute a runnable inside the PagingManager's executor- Specified by:
executein interfacePagingManager
-
injectMonitor
public void injectMonitor(FileStoreMonitor monitor) throws Exception
- Specified by:
injectMonitorin interfacePagingManager- Throws:
Exception
-
setDiskFull
protected void setDiskFull(boolean diskFull)
-
isDiskFull
public boolean isDiskFull()
- Specified by:
isDiskFullin interfacePagingManager
-
getDiskUsableSpace
public long getDiskUsableSpace()
- Specified by:
getDiskUsableSpacein interfacePagingManager
-
getDiskTotalSpace
public long getDiskTotalSpace()
- Specified by:
getDiskTotalSpacein interfacePagingManager
-
isUsingGlobalSize
public boolean isUsingGlobalSize()
- Specified by:
isUsingGlobalSizein interfacePagingManager
-
checkMemory
public void checkMemory(Runnable runWhenAvailable)
Description copied from interface:PagingManagerUse this when you have no refernce of an address. (anonymous AMQP Producers for example)- Specified by:
checkMemoryin interfacePagingManager
-
checkStorage
public void checkStorage(Runnable runWhenAvailable)
Description copied from interface:PagingManagerUse this when you have no refernce of an address. (anonymous AMQP Producers for example)- Specified by:
checkStoragein interfacePagingManager
-
isGlobalFull
public boolean isGlobalFull()
- Specified by:
isGlobalFullin interfacePagingManager
-
disableCleanup
public void disableCleanup()
- Specified by:
disableCleanupin interfacePagingManager
-
resumeCleanup
public void resumeCleanup()
- Specified by:
resumeCleanupin interfacePagingManager
-
getStoreNames
public SimpleString[] getStoreNames()
- Specified by:
getStoreNamesin interfacePagingManager
-
reloadStores
public void reloadStores() throws ExceptionDescription copied from interface:PagingManagerReload previously created PagingStores into memory- Specified by:
reloadStoresin interfacePagingManager- Throws:
Exception
-
deletePageStore
public void deletePageStore(SimpleString storeName) throws Exception
- Specified by:
deletePageStorein interfacePagingManager- Throws:
Exception
-
getPageStore
public PagingStore getPageStore(SimpleString rawStoreName) throws Exception
This method creates a new store if not exist.- Specified by:
getPageStorein interfacePagingManager- Throws:
Exception
-
addTransaction
public void addTransaction(PageTransactionInfo pageTransaction)
Description copied from interface:PagingManagerPoint to inform/restoring Transactions used when the messages were added into paging- Specified by:
addTransactionin interfacePagingManager
-
removeTransaction
public void removeTransaction(long id)
- Specified by:
removeTransactionin interfacePagingManager
-
getTransaction
public PageTransactionInfo getTransaction(long id)
Description copied from interface:PagingManagerPoint to inform/restoring Transactions used when the messages were added into paging- Specified by:
getTransactionin interfacePagingManager
-
getTransactions
public Map<Long,PageTransactionInfo> getTransactions()
- Specified by:
getTransactionsin interfacePagingManager
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceActiveMQComponent
-
start
public void start() throws Exception- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
counterSnapshot
public void counterSnapshot()
- Specified by:
counterSnapshotin interfacePagingManager
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceActiveMQComponent- Throws:
Exception
-
processReload
public void processReload() throws Exception- Specified by:
processReloadin interfacePagingManager- Throws:
Exception
-
unlock
public void unlock()
Description copied from interface:PagingManagerUnlock the manager.- Specified by:
unlockin interfacePagingManager- See Also:
PagingManager.lock()
-
lock
public void lock()
Description copied from interface:PagingManagerLock the manager. This method should not be called during normal PagingManager usage.- Specified by:
lockin interfacePagingManager
-
forEachTransaction
public void forEachTransaction(BiConsumer<Long,PageTransactionInfo> transactionConsumer)
- Specified by:
forEachTransactionin interfacePagingManager
-
rebuildCounters
public Future<Object> rebuildCounters(Set<Long> storedLargeMessages)
Description copied from interface:PagingManagerRebuilds all page counters for destinations that are paging in the background.- Specified by:
rebuildCountersin interfacePagingManager
-
-