Class PagingManagerImpl
java.lang.Object
org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl
- All Implemented Interfaces:
PagingManager,ActiveMQComponent,HierarchicalRepositoryChangeListener
-
Constructor Summary
ConstructorsConstructorDescriptionPagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository) PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, long maxSize, long maxMessages, SimpleString managementAddress, ActiveMQServer server) PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, SimpleString managementAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockedStore(PagingStore store) addSize(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 voidvoidcheckStorage(Runnable runWhenAvailable) Use this when you have no refernce of an address.voidvoiddeletePageStore(SimpleString storeName) voidvoidExecute a runnable inside the PagingManager's executorvoidforEachTransaction(BiConsumer<Long, PageTransactionInfo> transactionConsumer) longlonglonglonglonglonggetPageStore(SimpleString rawStoreName) This method creates a new store if not exist.getTransaction(long id) Point to inform/restoring Transactions used when the messages were added into pagingvoidinjectMonitor(FileStoreMonitor monitor) booleanbooleanbooleanbooleanbooleanvoidlock()Lock the manager.voidonChange()voidrebuildCounters(Set<Long> storedLargeMessages) Rebuilds all page counters for destinations that are paging in the background.voidReload previously created PagingStores into memoryvoidremoveTransaction(long id) voidvoidprotected 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, waitMethods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStopMethods inherited from interface org.apache.activemq.artemis.core.paging.PagingManager
addSize, addSizeOnly
-
Constructor Details
-
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, long maxSize, long maxMessages, SimpleString managementAddress, ActiveMQServer server) -
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository) -
PagingManagerImpl
public PagingManagerImpl(PagingStoreFactory pagingSPI, HierarchicalRepository<AddressSettings> addressSettingsRepository, SimpleString managementAddress)
-
-
Method Details
-
replacePageStoreFactory
-
getPagingStoreFactory
-
getMaxSize
public long getMaxSize()- Specified by:
getMaxSizein interfacePagingManager
-
getMaxMessages
public long getMaxMessages()- Specified by:
getMaxMessagesin interfacePagingManager
-
addBlockedStore
- Specified by:
addBlockedStorein interfacePagingManager
-
getBlockedSet
-
onChange
public void onChange()- Specified by:
onChangein interfaceHierarchicalRepositoryChangeListener
-
addSize
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
Description copied from interface:PagingManagerExecute a runnable inside the PagingManager's executor- Specified by:
executein interfacePagingManager
-
injectMonitor
- 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
Description copied from interface:PagingManagerUse this when you have no refernce of an address. (anonymous AMQP Producers for example)- Specified by:
checkMemoryin interfacePagingManager
-
checkStorage
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
- Specified by:
getStoreNamesin interfacePagingManager
-
reloadStores
Description copied from interface:PagingManagerReload previously created PagingStores into memory- Specified by:
reloadStoresin interfacePagingManager- Throws:
Exception
-
deletePageStore
- Specified by:
deletePageStorein interfacePagingManager- Throws:
Exception
-
getPageStore
This method creates a new store if not exist.- Specified by:
getPageStorein interfacePagingManager- Returns:
- the PageStore associated with the address; a new page store is created if necessary
- Throws:
Exception
-
addTransaction
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
Description copied from interface:PagingManagerPoint to inform/restoring Transactions used when the messages were added into paging- Specified by:
getTransactionin interfacePagingManager
-
getTransactions
- Specified by:
getTransactionsin interfacePagingManager
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceActiveMQComponent
-
isRebuildingCounters
public boolean isRebuildingCounters()- Specified by:
isRebuildingCountersin interfacePagingManager
-
start
- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
counterSnapshot
public void counterSnapshot()- Specified by:
counterSnapshotin interfacePagingManager
-
stop
- Specified by:
stopin interfaceActiveMQComponent- Throws:
Exception
-
processReload
- Specified by:
processReloadin interfacePagingManager- Throws:
Exception
-
unlock
public void unlock()Description copied from interface:PagingManagerUnlock the manager.- Specified by:
unlockin interfacePagingManager- See Also:
-
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
- Specified by:
forEachTransactionin interfacePagingManager
-
rebuildCounters
Description copied from interface:PagingManagerRebuilds all page counters for destinations that are paging in the background.- Specified by:
rebuildCountersin interfacePagingManager
-