Class AbstractJournalStorageManager
- java.lang.Object
-
- org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
-
- org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager
-
- All Implemented Interfaces:
StorageManager,ActiveMQComponent,CriticalComponent,IDGenerator
- Direct Known Subclasses:
JournalStorageManager
public abstract class AbstractJournalStorageManager extends CriticalComponentImpl implements StorageManager
Controls access to the journals and other storage files such as the ones used to store pages and large messages. This class must control writing of any non-transient data, as it is the key point for synchronizing any replicating backup server.Using this class also ensures that locks are acquired in the right order, avoiding dead-locks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractJournalStorageManager.JournalContent-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.core.persistence.StorageManager
StorageManager.LargeMessageExtension
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractJournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutorFactory)AbstractJournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutorFactory, IOCriticalErrorListener criticalErrorListener)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAddressBinding(long tx, AddressInfo addressInfo)voidaddGrouping(GroupBinding groupBinding)voidaddQueueBinding(long tx, Binding binding)booleanaddToPage(PagingStore store, Message msg, Transaction tx, RouteContextList listCtx)Write message to page if we are paging.voidafterCompleteOperations(IOCallback run)voidafterStoreOperations(IOCallback run)This is similar to afterComplete, however this only cares about the journal part.protected abstract voidbeforeStart()protected abstract voidbeforeStop()voidcheckInvalidPageTransactions(PagingManager pagingManager, Set<PageTransactionInfo> invalidPageTransactions)voidclearContext()ArtemisCloseablecloseableReadLock()Read lock the StorageManager.voidcommit(long txID)voidcommit(long txID, boolean lineUpContext)voidcommitBindings(long txID)voidconfirmPendingLargeMessage(long recordID)We don't need messageID now but we are likely to need it we ever decide to support a databasevoidconfirmPendingLargeMessageTX(Transaction tx, long messageID, long recordID)Confirms that a large message was finishedvoidcriticalError(Throwable error)voiddeleteAddressBinding(long tx, long addressBindingID)voiddeleteAddressSetting(SimpleString addressMatch)voiddeleteAddressStatus(long recordID)voiddeleteBridgeConfiguration(String bridgeName)voiddeleteConnector(String connectorName)voiddeleteCursorAcknowledge(long ackID)voiddeleteCursorAcknowledgeTransactional(long txID, long ackID)voiddeleteDivertConfiguration(String divertName)voiddeleteDuplicateID(long recordID)voiddeleteDuplicateIDTransactional(long txID, long recordID)voiddeleteGrouping(long tx, GroupBinding groupBinding)voiddeleteHeuristicCompletion(long id)voiddeleteID(long journalD)voiddeleteIncrementRecord(long txID, long recordID)voiddeleteKeyValuePair(String mapId, String key)voiddeleteMessage(long messageID)voiddeletePageComplete(long ackID)voiddeletePageCounter(long txID, long recordID)voiddeletePageTransactional(long recordID)voiddeletePendingPageCounter(long txID, long recordID)voiddeleteQueueBinding(long tx, long queueBindingID)voiddeleteQueueStatus(long recordID)voiddeleteRole(String username)voiddeleteSecuritySetting(SimpleString addressMatch)voiddeleteUser(String username)longgenerateID()JournalgetBindingsJournal()ConfigurationgetConfig()OperationContextgetContext()Get the context associated with the thread for later reuselonggetCurrentID()IDGeneratorgetIDGenerator()longgetMaxRecordSize()JournalgetMessageJournal()Map<String,PersistedKeyValuePair>getPersistedKeyValuePairs(String mapId)Map<String,PersistedRole>getPersistedRoles()Map<String,PersistedUser>getPersistedUsers()protected abstract voidinit(Configuration config, IOCriticalErrorListener criticalErrorListener)Called during initialization.booleanisStarted()voidlineUpContext()JournalLoadInformationloadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos, List<AddressBindingInfo> addressBindingInfos)JournalLoadInformation[]loadInternalOnly()TODO: Is this still being used ?JournalLoadInformationloadMessageJournal(PostOffice postOffice, PagingManager pagingManager, ResourceManager resourceManager, Map<Long,QueueBindingInfo> queueInfos, Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap, Set<Pair<Long,Long>> pendingLargeMessages, Set<Long> storedLargeMessages, List<PageCountPending> pendingNonTXPageCounter, JournalLoader journalLoader)protected static PersistentAddressBindingEncodingnewAddressBindingEncoding(long id, ActiveMQBuffer buffer)OperationContextnewContext(Executor executor1)It just creates an OperationContext without associating itprotected static PersistentQueueBindingEncodingnewQueueBindingEncoding(long id, ActiveMQBuffer buffer)protected static QueueStatusEncodingnewQueueStatusEncoding(long id, ActiveMQBuffer buffer)protected static PersistedSecuritySettingnewSecurityRecord(long id, ActiveMQBuffer buffer)OperationContextnewSingleThreadContext()protected abstract LargeServerMessageparseLargeMessage(ActiveMQBuffer buff)protected abstract voidperformCachedLargeMessageDeletes()Assumption is that this is only called with a writeLock on the StorageManager.voidpersistIdGenerator()Closes theIDGeneratorpersisting the current record ID.voidprepare(long txID, Xid xid)List<PersistedAddressSetting>recoverAddressSettings()List<PersistedBridgeConfiguration>recoverBridgeConfigurations()List<PersistedConnector>recoverConnectors()List<PersistedDivertConfiguration>recoverDivertConfigurations()List<PersistedSecuritySetting>recoverSecuritySettings()voidrollback(long txID)voidrollbackBindings(long txID)voidsetContext(OperationContext context)Set the context back to the threadvoidstart()voidstop()voidstop(boolean ioCriticalError, boolean sendFailover)voidstoreAcknowledge(long queueID, long messageID)voidstoreAcknowledgeTransactional(long txID, long queueID, long messageID)voidstoreAddressSetting(PersistedAddressSetting addressSetting)longstoreAddressStatus(long addressID, AddressQueueStatus status)voidstoreBridgeConfiguration(PersistedBridgeConfiguration persistedBridgeConfiguration)voidstoreConnector(PersistedConnector persistedConnector)voidstoreCursorAcknowledge(long queueID, PagePosition position)voidstoreCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position)voidstoreDivertConfiguration(PersistedDivertConfiguration persistedDivertConfiguration)voidstoreDuplicateID(SimpleString address, byte[] duplID, long recordID)voidstoreDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID)longstoreHeuristicCompletion(Xid xid, boolean isCommit)voidstoreID(long journalID, long id)Stores the id from IDManager.voidstoreKeyValuePair(PersistedKeyValuePair persistedKeyValuePair)voidstoreMessage(Message message)voidstoreMessageTransactional(long txID, Message message)voidstorePageCompleteTransactional(long txID, long queueID, PagePosition position)longstorePageCounter(long txID, long queueID, long value, long persistentSize)longstorePageCounterInc(long queueID, int value, long persistentSize)longstorePageCounterInc(long txID, long queueID, int value, long persistentSize)voidstorePageTransaction(long txID, PageTransactionInfo pageTransaction)longstorePendingCounter(long queueID, long pageID)longstoreQueueStatus(long queueID, AddressQueueStatus status)voidstoreReference(long queueID, long messageID, boolean last)voidstoreReferenceTransactional(long txID, long queueID, long messageID)voidstoreRole(PersistedRole persistedRole)voidstoreSecuritySetting(PersistedSecuritySetting persistedRoles)voidstoreUser(PersistedUser persistedUser)voidupdateDeliveryCount(MessageReference ref)voidupdateDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID)voidupdatePageTransaction(long txID, PageTransactionInfo pageTransaction, int depages)voidupdateQueueBinding(long tx, Binding binding)voidupdateScheduledDeliveryTime(MessageReference ref)voidupdateScheduledDeliveryTimeTransactional(long txID, MessageReference ref)voidwaitOnOperations()Block until the operations are done.booleanwaitOnOperations(long timeout)Block until the operations are done.-
Methods inherited from class org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
checkExpiration, getCriticalAnalyzer, measureCritical
-
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.persistence.StorageManager
addBytesToLargeMessage, addBytesToLargeMessage, allocateDirectBuffer, createFileForLargeMessage, createFileForLargeMessage, createLargeMessage, createLargeMessage, deleteLargeMessageBody, freeDirectBuffer, getJournalSequentialFileFactory, injectMonitor, largeMessageClosed, largeMessageCreated, loadMessageJournal, pageClosed, pageDeleted, pageWrite, recoverLargeMessagesOnFolder, startReplication, stopReplication
-
-
-
-
Field Detail
-
CRITICAL_PATHS
protected static final int CRITICAL_PATHS
- See Also:
- Constant Field Values
-
CRITICAL_STORE
protected static final int CRITICAL_STORE
- See Also:
- Constant Field Values
-
CRITICAL_STOP
protected static final int CRITICAL_STOP
- See Also:
- Constant Field Values
-
CRITICAL_STOP_2
protected static final int CRITICAL_STOP_2
- See Also:
- Constant Field Values
-
idGenerator
protected BatchingIDGenerator idGenerator
-
ioExecutorFactory
protected final ExecutorFactory ioExecutorFactory
-
scheduledExecutorService
protected final ScheduledExecutorService scheduledExecutorService
-
storageManagerLock
protected final ReentrantReadWriteLock storageManagerLock
-
unlockCloseable
protected final ArtemisCloseable unlockCloseable
-
dummyCloseable
protected static final ArtemisCloseable dummyCloseable
-
messageJournal
protected Journal messageJournal
-
bindingsJournal
protected Journal bindingsJournal
-
started
protected volatile boolean started
-
executorFactory
protected final ExecutorFactory executorFactory
Used to create Operation Contexts
-
journalLoaded
protected boolean journalLoaded
-
ioCriticalErrorListener
protected final IOCriticalErrorListener ioCriticalErrorListener
-
config
protected final Configuration config
-
mapPersistedSecuritySettings
protected final Map<SimpleString,PersistedSecuritySetting> mapPersistedSecuritySettings
-
mapPersistedAddressSettings
protected final Map<SimpleString,PersistedAddressSetting> mapPersistedAddressSettings
-
mapPersistedDivertConfigurations
protected final Map<String,PersistedDivertConfiguration> mapPersistedDivertConfigurations
-
mapPersistedBridgeConfigurations
protected final Map<String,PersistedBridgeConfiguration> mapPersistedBridgeConfigurations
-
mapPersistedConnectors
protected final Map<String,PersistedConnector> mapPersistedConnectors
-
mapPersistedUsers
protected final Map<String,PersistedUser> mapPersistedUsers
-
mapPersistedRoles
protected final Map<String,PersistedRole> mapPersistedRoles
-
mapPersistedKeyValuePairs
protected final Map<String,Map<String,PersistedKeyValuePair>> mapPersistedKeyValuePairs
-
largeMessagesToDelete
protected final ConcurrentLongHashMap<LargeServerMessage> largeMessagesToDelete
-
-
Constructor Detail
-
AbstractJournalStorageManager
public AbstractJournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutorFactory)
-
AbstractJournalStorageManager
public AbstractJournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutorFactory, IOCriticalErrorListener criticalErrorListener)
-
-
Method Detail
-
getConfig
public Configuration getConfig()
-
getMaxRecordSize
public long getMaxRecordSize()
- Specified by:
getMaxRecordSizein interfaceStorageManager
-
init
protected abstract void init(Configuration config, IOCriticalErrorListener criticalErrorListener)
Called during initialization. Used by implementations to setup Journals, Stores etc...- Parameters:
config-criticalErrorListener-
-
criticalError
public void criticalError(Throwable error)
- Specified by:
criticalErrorin interfaceStorageManager
-
clearContext
public void clearContext()
- Specified by:
clearContextin interfaceStorageManager
-
getIDGenerator
public IDGenerator getIDGenerator()
-
waitOnOperations
public final void waitOnOperations() throws ExceptionDescription copied from interface:StorageManagerBlock until the operations are done. Warning: Don't use it inside an ordered executor, otherwise the system may lock up in case of the pools are full- Specified by:
waitOnOperationsin interfaceStorageManager- Throws:
Exception
-
waitOnOperations
public final boolean waitOnOperations(long timeout) throws ExceptionDescription copied from interface:StorageManagerBlock until the operations are done. Warning: Don't use it inside an ordered executor, otherwise the system may lock up in case of the pools are full- Specified by:
waitOnOperationsin interfaceStorageManager- Throws:
Exception
-
getContext
public OperationContext getContext()
Description copied from interface:StorageManagerGet the context associated with the thread for later reuse- Specified by:
getContextin interfaceStorageManager
-
setContext
public void setContext(OperationContext context)
Description copied from interface:StorageManagerSet the context back to the thread- Specified by:
setContextin interfaceStorageManager
-
newSingleThreadContext
public OperationContext newSingleThreadContext()
- Specified by:
newSingleThreadContextin interfaceStorageManager
-
newContext
public OperationContext newContext(Executor executor1)
Description copied from interface:StorageManagerIt just creates an OperationContext without associating it- Specified by:
newContextin interfaceStorageManager
-
afterCompleteOperations
public void afterCompleteOperations(IOCallback run)
- Specified by:
afterCompleteOperationsin interfaceStorageManager
-
afterStoreOperations
public void afterStoreOperations(IOCallback run)
Description copied from interface:StorageManagerThis is similar to afterComplete, however this only cares about the journal part.- Specified by:
afterStoreOperationsin interfaceStorageManager
-
generateID
public long generateID()
- Specified by:
generateIDin interfaceIDGenerator
-
getCurrentID
public long getCurrentID()
- Specified by:
getCurrentIDin interfaceIDGenerator
-
confirmPendingLargeMessageTX
public void confirmPendingLargeMessageTX(Transaction tx, long messageID, long recordID) throws Exception
Description copied from interface:StorageManagerConfirms that a large message was finished- Specified by:
confirmPendingLargeMessageTXin interfaceStorageManager- Throws:
Exception
-
confirmPendingLargeMessage
public void confirmPendingLargeMessage(long recordID) throws ExceptionWe don't need messageID now but we are likely to need it we ever decide to support a database- Specified by:
confirmPendingLargeMessagein interfaceStorageManager- Throws:
Exception
-
storeMessage
public void storeMessage(Message message) throws Exception
- Specified by:
storeMessagein interfaceStorageManager- Throws:
Exception
-
storeReference
public void storeReference(long queueID, long messageID, boolean last) throws Exception- Specified by:
storeReferencein interfaceStorageManager- Throws:
Exception
-
closeableReadLock
public ArtemisCloseable closeableReadLock()
Description copied from interface:StorageManagerRead lock the StorageManager. USE WITH CARE!The main lock is used to write lock the whole manager when starting replication. Sub-systems, say Paging classes, that use locks of their own AND also write through the StorageManager MUST first read lock the storageManager before taking their own locks. Otherwise, we may dead-lock when starting replication sync.
- Specified by:
closeableReadLockin interfaceStorageManager
-
storeAcknowledge
public void storeAcknowledge(long queueID, long messageID) throws Exception- Specified by:
storeAcknowledgein interfaceStorageManager- Throws:
Exception
-
storeCursorAcknowledge
public void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception- Specified by:
storeCursorAcknowledgein interfaceStorageManager- Throws:
Exception
-
deleteMessage
public void deleteMessage(long messageID) throws Exception- Specified by:
deleteMessagein interfaceStorageManager- Throws:
Exception
-
updateScheduledDeliveryTime
public void updateScheduledDeliveryTime(MessageReference ref) throws Exception
- Specified by:
updateScheduledDeliveryTimein interfaceStorageManager- Throws:
Exception
-
storeDuplicateID
public void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
- Specified by:
storeDuplicateIDin interfaceStorageManager- Throws:
Exception
-
deleteDuplicateID
public void deleteDuplicateID(long recordID) throws Exception- Specified by:
deleteDuplicateIDin interfaceStorageManager- Throws:
Exception
-
storeMessageTransactional
public void storeMessageTransactional(long txID, Message message) throws Exception- Specified by:
storeMessageTransactionalin interfaceStorageManager- Throws:
Exception
-
storePageTransaction
public void storePageTransaction(long txID, PageTransactionInfo pageTransaction) throws Exception- Specified by:
storePageTransactionin interfaceStorageManager- Throws:
Exception
-
updatePageTransaction
public void updatePageTransaction(long txID, PageTransactionInfo pageTransaction, int depages) throws Exception- Specified by:
updatePageTransactionin interfaceStorageManager- Throws:
Exception
-
storeReferenceTransactional
public void storeReferenceTransactional(long txID, long queueID, long messageID) throws Exception- Specified by:
storeReferenceTransactionalin interfaceStorageManager- Throws:
Exception
-
storeAcknowledgeTransactional
public void storeAcknowledgeTransactional(long txID, long queueID, long messageID) throws Exception- Specified by:
storeAcknowledgeTransactionalin interfaceStorageManager- Throws:
Exception
-
storeCursorAcknowledgeTransactional
public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception- Specified by:
storeCursorAcknowledgeTransactionalin interfaceStorageManager- Throws:
Exception
-
storePageCompleteTransactional
public void storePageCompleteTransactional(long txID, long queueID, PagePosition position) throws Exception- Specified by:
storePageCompleteTransactionalin interfaceStorageManager- Throws:
Exception
-
deletePageComplete
public void deletePageComplete(long ackID) throws Exception- Specified by:
deletePageCompletein interfaceStorageManager- Throws:
Exception
-
deleteCursorAcknowledgeTransactional
public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception- Specified by:
deleteCursorAcknowledgeTransactionalin interfaceStorageManager- Throws:
Exception
-
deleteCursorAcknowledge
public void deleteCursorAcknowledge(long ackID) throws Exception- Specified by:
deleteCursorAcknowledgein interfaceStorageManager- Throws:
Exception
-
storeHeuristicCompletion
public long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
- Specified by:
storeHeuristicCompletionin interfaceStorageManager- Throws:
Exception
-
deleteHeuristicCompletion
public void deleteHeuristicCompletion(long id) throws Exception- Specified by:
deleteHeuristicCompletionin interfaceStorageManager- Throws:
Exception
-
deletePageTransactional
public void deletePageTransactional(long recordID) throws Exception- Specified by:
deletePageTransactionalin interfaceStorageManager- Throws:
Exception
-
updateScheduledDeliveryTimeTransactional
public void updateScheduledDeliveryTimeTransactional(long txID, MessageReference ref) throws Exception- Specified by:
updateScheduledDeliveryTimeTransactionalin interfaceStorageManager- Throws:
Exception
-
prepare
public void prepare(long txID, Xid xid) throws Exception- Specified by:
preparein interfaceStorageManager- Throws:
Exception
-
commit
public void commit(long txID) throws Exception- Specified by:
commitin interfaceStorageManager- Throws:
Exception
-
commitBindings
public void commitBindings(long txID) throws Exception- Specified by:
commitBindingsin interfaceStorageManager- Throws:
Exception
-
rollbackBindings
public void rollbackBindings(long txID) throws Exception- Specified by:
rollbackBindingsin interfaceStorageManager- Throws:
Exception
-
commit
public void commit(long txID, boolean lineUpContext) throws Exception- Specified by:
commitin interfaceStorageManager- Throws:
Exception
-
rollback
public void rollback(long txID) throws Exception- Specified by:
rollbackin interfaceStorageManager- Throws:
Exception
-
storeDuplicateIDTransactional
public void storeDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception- Specified by:
storeDuplicateIDTransactionalin interfaceStorageManager- Throws:
Exception
-
updateDuplicateIDTransactional
public void updateDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception- Specified by:
updateDuplicateIDTransactionalin interfaceStorageManager- Throws:
Exception
-
deleteDuplicateIDTransactional
public void deleteDuplicateIDTransactional(long txID, long recordID) throws Exception- Specified by:
deleteDuplicateIDTransactionalin interfaceStorageManager- Throws:
Exception
-
updateDeliveryCount
public void updateDeliveryCount(MessageReference ref) throws Exception
- Specified by:
updateDeliveryCountin interfaceStorageManager- Throws:
Exception
-
storeAddressSetting
public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
- Specified by:
storeAddressSettingin interfaceStorageManager- Throws:
Exception
-
recoverAddressSettings
public List<PersistedAddressSetting> recoverAddressSettings() throws Exception
- Specified by:
recoverAddressSettingsin interfaceStorageManager- Throws:
Exception
-
recoverSecuritySettings
public List<PersistedSecuritySetting> recoverSecuritySettings() throws Exception
- Specified by:
recoverSecuritySettingsin interfaceStorageManager- Throws:
Exception
-
storeSecuritySetting
public void storeSecuritySetting(PersistedSecuritySetting persistedRoles) throws Exception
- Specified by:
storeSecuritySettingin interfaceStorageManager- Throws:
Exception
-
storeDivertConfiguration
public void storeDivertConfiguration(PersistedDivertConfiguration persistedDivertConfiguration) throws Exception
- Specified by:
storeDivertConfigurationin interfaceStorageManager- Throws:
Exception
-
deleteDivertConfiguration
public void deleteDivertConfiguration(String divertName) throws Exception
- Specified by:
deleteDivertConfigurationin interfaceStorageManager- Throws:
Exception
-
recoverDivertConfigurations
public List<PersistedDivertConfiguration> recoverDivertConfigurations()
- Specified by:
recoverDivertConfigurationsin interfaceStorageManager
-
storeBridgeConfiguration
public void storeBridgeConfiguration(PersistedBridgeConfiguration persistedBridgeConfiguration) throws Exception
- Specified by:
storeBridgeConfigurationin interfaceStorageManager- Throws:
Exception
-
deleteBridgeConfiguration
public void deleteBridgeConfiguration(String bridgeName) throws Exception
- Specified by:
deleteBridgeConfigurationin interfaceStorageManager- Throws:
Exception
-
recoverBridgeConfigurations
public List<PersistedBridgeConfiguration> recoverBridgeConfigurations()
- Specified by:
recoverBridgeConfigurationsin interfaceStorageManager
-
storeConnector
public void storeConnector(PersistedConnector persistedConnector) throws Exception
- Specified by:
storeConnectorin interfaceStorageManager- Throws:
Exception
-
deleteConnector
public void deleteConnector(String connectorName) throws Exception
- Specified by:
deleteConnectorin interfaceStorageManager- Throws:
Exception
-
recoverConnectors
public List<PersistedConnector> recoverConnectors()
- Specified by:
recoverConnectorsin interfaceStorageManager
-
storeUser
public void storeUser(PersistedUser persistedUser) throws Exception
- Specified by:
storeUserin interfaceStorageManager- Throws:
Exception
-
deleteUser
public void deleteUser(String username) throws Exception
- Specified by:
deleteUserin interfaceStorageManager- Throws:
Exception
-
getPersistedUsers
public Map<String,PersistedUser> getPersistedUsers()
- Specified by:
getPersistedUsersin interfaceStorageManager
-
storeRole
public void storeRole(PersistedRole persistedRole) throws Exception
- Specified by:
storeRolein interfaceStorageManager- Throws:
Exception
-
deleteRole
public void deleteRole(String username) throws Exception
- Specified by:
deleteRolein interfaceStorageManager- Throws:
Exception
-
getPersistedRoles
public Map<String,PersistedRole> getPersistedRoles()
- Specified by:
getPersistedRolesin interfaceStorageManager
-
storeKeyValuePair
public void storeKeyValuePair(PersistedKeyValuePair persistedKeyValuePair) throws Exception
- Specified by:
storeKeyValuePairin interfaceStorageManager- Throws:
Exception
-
deleteKeyValuePair
public void deleteKeyValuePair(String mapId, String key) throws Exception
- Specified by:
deleteKeyValuePairin interfaceStorageManager- Throws:
Exception
-
getPersistedKeyValuePairs
public Map<String,PersistedKeyValuePair> getPersistedKeyValuePairs(String mapId)
- Specified by:
getPersistedKeyValuePairsin interfaceStorageManager
-
storeID
public void storeID(long journalID, long id) throws ExceptionDescription copied from interface:StorageManagerStores the id from IDManager.- Specified by:
storeIDin interfaceStorageManager- Throws:
Exception
-
deleteID
public void deleteID(long journalD) throws Exception- Specified by:
deleteIDin interfaceStorageManager- Throws:
Exception
-
deleteAddressSetting
public void deleteAddressSetting(SimpleString addressMatch) throws Exception
- Specified by:
deleteAddressSettingin interfaceStorageManager- Throws:
Exception
-
deleteSecuritySetting
public void deleteSecuritySetting(SimpleString addressMatch) throws Exception
- Specified by:
deleteSecuritySettingin interfaceStorageManager- Throws:
Exception
-
loadMessageJournal
public JournalLoadInformation loadMessageJournal(PostOffice postOffice, PagingManager pagingManager, ResourceManager resourceManager, Map<Long,QueueBindingInfo> queueInfos, Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap, Set<Pair<Long,Long>> pendingLargeMessages, Set<Long> storedLargeMessages, List<PageCountPending> pendingNonTXPageCounter, JournalLoader journalLoader) throws Exception
- Specified by:
loadMessageJournalin interfaceStorageManager- Throws:
Exception
-
checkInvalidPageTransactions
public void checkInvalidPageTransactions(PagingManager pagingManager, Set<PageTransactionInfo> invalidPageTransactions)
-
addGrouping
public void addGrouping(GroupBinding groupBinding) throws Exception
- Specified by:
addGroupingin interfaceStorageManager- Throws:
Exception
-
deleteGrouping
public void deleteGrouping(long tx, GroupBinding groupBinding) throws Exception- Specified by:
deleteGroupingin interfaceStorageManager- Throws:
Exception
-
updateQueueBinding
public void updateQueueBinding(long tx, Binding binding) throws Exception- Specified by:
updateQueueBindingin interfaceStorageManager- Throws:
Exception
-
addQueueBinding
public void addQueueBinding(long tx, Binding binding) throws Exception- Specified by:
addQueueBindingin interfaceStorageManager- Throws:
Exception
-
deleteQueueBinding
public void deleteQueueBinding(long tx, long queueBindingID) throws Exception- Specified by:
deleteQueueBindingin interfaceStorageManager- Throws:
Exception
-
storeQueueStatus
public long storeQueueStatus(long queueID, AddressQueueStatus status) throws Exception- Specified by:
storeQueueStatusin interfaceStorageManager- Parameters:
queueID- The id of the queuestatus- The current status of the queue. (Reserved for future use, ATM we only use this record for PAUSED)- Returns:
- the id of the journal
- Throws:
Exception
-
deleteQueueStatus
public void deleteQueueStatus(long recordID) throws Exception- Specified by:
deleteQueueStatusin interfaceStorageManager- Throws:
Exception
-
storeAddressStatus
public long storeAddressStatus(long addressID, AddressQueueStatus status) throws Exception- Specified by:
storeAddressStatusin interfaceStorageManager- Throws:
Exception
-
deleteAddressStatus
public void deleteAddressStatus(long recordID) throws Exception- Specified by:
deleteAddressStatusin interfaceStorageManager- Throws:
Exception
-
addAddressBinding
public void addAddressBinding(long tx, AddressInfo addressInfo) throws Exception- Specified by:
addAddressBindingin interfaceStorageManager- Throws:
Exception
-
deleteAddressBinding
public void deleteAddressBinding(long tx, long addressBindingID) throws Exception- Specified by:
deleteAddressBindingin interfaceStorageManager- Throws:
Exception
-
storePageCounterInc
public long storePageCounterInc(long txID, long queueID, int value, long persistentSize) throws Exception- Specified by:
storePageCounterIncin interfaceStorageManager- Returns:
- the ID with the increment record
- Throws:
Exception
-
storePageCounterInc
public long storePageCounterInc(long queueID, int value, long persistentSize) throws Exception- Specified by:
storePageCounterIncin interfaceStorageManager- Returns:
- the ID with the increment record
- Throws:
Exception
-
storePageCounter
public long storePageCounter(long txID, long queueID, long value, long persistentSize) throws Exception- Specified by:
storePageCounterin interfaceStorageManager- Returns:
- The ID with the stored counter
- Throws:
Exception
-
storePendingCounter
public long storePendingCounter(long queueID, long pageID) throws Exception- Specified by:
storePendingCounterin interfaceStorageManager- Throws:
Exception
-
deleteIncrementRecord
public void deleteIncrementRecord(long txID, long recordID) throws Exception- Specified by:
deleteIncrementRecordin interfaceStorageManager- Throws:
Exception
-
deletePageCounter
public void deletePageCounter(long txID, long recordID) throws Exception- Specified by:
deletePageCounterin interfaceStorageManager- Throws:
Exception
-
deletePendingPageCounter
public void deletePendingPageCounter(long txID, long recordID) throws Exception- Specified by:
deletePendingPageCounterin interfaceStorageManager- Throws:
Exception
-
loadBindingJournal
public JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos, List<AddressBindingInfo> addressBindingInfos) throws Exception
- Specified by:
loadBindingJournalin interfaceStorageManager- Throws:
Exception
-
lineUpContext
public void lineUpContext()
- Specified by:
lineUpContextin interfaceStorageManager
-
start
public void start() throws Exception- Specified by:
startin interfaceActiveMQComponent- Throws:
Exception
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceActiveMQComponent- Throws:
Exception
-
persistIdGenerator
public void persistIdGenerator()
Description copied from interface:StorageManagerCloses theIDGeneratorpersisting the current record ID.Effectively a "pre-stop" method. Necessary due to the "stop"-order at
ActiveMQServerImpl- Specified by:
persistIdGeneratorin interfaceStorageManager
-
performCachedLargeMessageDeletes
protected abstract void performCachedLargeMessageDeletes()
Assumption is that this is only called with a writeLock on the StorageManager.
-
stop
public void stop(boolean ioCriticalError, boolean sendFailover) throws Exception- Specified by:
stopin interfaceStorageManager- Parameters:
ioCriticalError- is the server being stopped due to an IO critical error.sendFailover- this is to send the replication stopping in case of replication.- Throws:
Exception
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceActiveMQComponent
-
loadInternalOnly
public JournalLoadInformation[] loadInternalOnly() throws Exception
TODO: Is this still being used ?- Throws:
Exception
-
getMessageJournal
public Journal getMessageJournal()
- Specified by:
getMessageJournalin interfaceStorageManager- Returns:
- the message journal
-
getBindingsJournal
public Journal getBindingsJournal()
- Specified by:
getBindingsJournalin interfaceStorageManager- Returns:
- the bindings journal
-
parseLargeMessage
protected abstract LargeServerMessage parseLargeMessage(ActiveMQBuffer buff) throws Exception
- Throws:
Exception
-
newSecurityRecord
protected static PersistedSecuritySetting newSecurityRecord(long id, ActiveMQBuffer buffer)
- Parameters:
id-buffer-- Returns:
-
newQueueBindingEncoding
protected static PersistentQueueBindingEncoding newQueueBindingEncoding(long id, ActiveMQBuffer buffer)
- Parameters:
id-buffer-- Returns:
-
newQueueStatusEncoding
protected static QueueStatusEncoding newQueueStatusEncoding(long id, ActiveMQBuffer buffer)
- Parameters:
id-buffer-- Returns:
-
newAddressBindingEncoding
protected static PersistentAddressBindingEncoding newAddressBindingEncoding(long id, ActiveMQBuffer buffer)
-
addToPage
public boolean addToPage(PagingStore store, Message msg, Transaction tx, RouteContextList listCtx) throws Exception
Description copied from interface:StorageManagerWrite message to page if we are paging.- Specified by:
addToPagein interfaceStorageManager- Returns:
trueif we are paging and have handled the data,falseif the data needs to be sent to the journal- Throws:
Exception
-
-