Class JournalStorageManager
java.lang.Object
org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager
org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager
- All Implemented Interfaces:
MapStorageManager,StorageManager,ActiveMQComponent,CriticalComponent,IDGenerator
- Direct Known Subclasses:
JDBCJournalStorageManager
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager
AbstractJournalStorageManager.JournalContentNested classes/interfaces inherited from interface org.apache.activemq.artemis.core.persistence.StorageManager
StorageManager.LargeMessageExtension -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected SequentialFileFactoryprotected SequentialFileFactoryprotected Stringprotected SequentialFileFactoryprotected Journalprotected Journalprotected ReplicationManagerFields inherited from class org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager
bindingsJournal, config, CRITICAL_PATHS, CRITICAL_STOP, CRITICAL_STOP_2, CRITICAL_STORE, dummyCloseable, executorFactory, idGenerator, ioCriticalErrorListener, ioExecutorFactory, journalLoaded, largeMessagesToDelete, mapPersistedAddressSettings, mapPersistedBridgeConfigurations, mapPersistedConnectors, mapPersistedDivertConfigurations, mapPersistedKeyValuePairs, mapPersistedRoles, mapPersistedSecuritySettings, mapPersistedUsers, messageJournal, scheduledExecutorService, started, storageManagerLock, unlockCloseable -
Constructor Summary
ConstructorsConstructorDescriptionJournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutors) JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutors, IOCriticalErrorListener criticalErrorListener) JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ExecutorFactory ioExecutors) JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ExecutorFactory ioExecutors, IOCriticalErrorListener criticalErrorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytesToLargeMessage(SequentialFile file, long messageId, byte[] bytes) voidaddBytesToLargeMessage(SequentialFile file, long messageId, ActiveMQBuffer bytes) allocateDirectBuffer(int size) AIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC.protected voidprotected voidcreateCoreLargeMessage(long id, Message message) Creates a new LargeServerMessage for the core Protocol with the given id.protected voidcreateFileForLargeMessage(long messageID, StorageManager.LargeMessageExtension extension) Instantiates a SequentialFile to be used for storing aLargeServerMessage.protected JournalcreateMessageJournal(Configuration config, IOCriticalErrorListener criticalErrorListener, int fileSize) voiddeleteLargeMessageBody(LargeServerMessage largeServerMessage) protected intfixJournalFileSize(int fileSize, int alignment) We need to correct the file size if its not a multiple of the alignementvoidfreeDirectBuffer(ByteBuffer buffer) AIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC.intgetAllowedPageSize(int pageSize) protected voidinit(Configuration config, IOCriticalErrorListener criticalErrorListener) Called during initialization.voidinjectMonitor(FileStoreMonitor monitor) booleanvoidlargeMessageClosed(LargeServerMessage largeServerMessage) onLargeMessageCreate(long id, LargeServerMessage largeMessage) Other protocols may inform the storage manager when a large message was created.voidpageClosed(SimpleString storeName, long pageNumber) voidpageDeleted(SimpleString storeName, long pageNumber) voidpageWrite(SimpleString address, PagedMessage message, long pageNumber, boolean storageUp, boolean originallyReplicated) protected LargeServerMessageprotected voidAssumption is that this is only called with a writeLock on the StorageManager.voidrecoverLargeMessagesOnFolder(Set<Long> storedLargeMessages) voidstartReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, boolean autoFailBack, long initialReplicationSyncTimeout) voidstop()voidstop(boolean ioCriticalError, boolean sendFailover) Stop thisStorageManagervoidStops replication by resetting replication-related fields to their 'unreplicated' state.Methods inherited from class org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager
addAddressBinding, addGrouping, addQueueBinding, addToPage, afterCompleteOperations, afterCompleteOperations, afterStoreOperations, asyncCommit, checkInvalidPageTransactions, clearContext, closeableReadLock, commit, commit, commitBindings, confirmPendingLargeMessage, confirmPendingLargeMessageTX, criticalError, deleteAddressBinding, deleteAddressSetting, deleteAddressStatus, deleteBridgeConfiguration, deleteConnector, deleteCursorAcknowledge, deleteCursorAcknowledgeTransactional, deleteDivertConfiguration, deleteDuplicateID, deleteDuplicateIDTransactional, deleteGrouping, deleteHeuristicCompletion, deleteID, deleteIncrementRecord, deleteKeyValuePair, deleteMapRecord, deleteMapRecordTx, deleteMessage, deletePageComplete, deletePageCounter, deletePageTransactional, deletePendingPageCounter, deleteQueueBinding, deleteQueueStatus, deleteRole, deleteSecuritySetting, deleteUser, generateID, getBindingsJournal, getConfig, getContext, getCurrentID, getIDGenerator, getMaxRecordSize, getMessageJournal, getPersistedKeyValuePairs, getPersistedRoles, getPersistedUsers, getWarningRecordSize, isStarted, lineUpContext, loadBindingJournal, loadInternalOnly, loadMessageJournal, newAddressBindingEncoding, newContext, newQueueBindingEncoding, newQueueStatusEncoding, newSecurityRecord, newSingleThreadContext, persistIdGenerator, prepare, recoverAddressSettings, recoverAddressSettings, recoverBridgeConfigurations, recoverConnectors, recoverDivertConfigurations, recoverSecuritySettings, rollback, rollbackBindings, setContext, start, storeAcknowledge, storeAcknowledgeTransactional, storeAddressSetting, storeAddressStatus, storeBridgeConfiguration, storeConnector, storeCursorAcknowledge, storeCursorAcknowledgeTransactional, storeDivertConfiguration, storeDuplicateID, storeDuplicateIDTransactional, storeHeuristicCompletion, storeID, storeKeyValuePair, storeMapRecord, storeMapRecord, storeMessage, storeMessageTransactional, storePageCompleteTransactional, storePageCounter, storePageCounterInc, storePageCounterInc, storePageTransaction, storePendingCounter, storeQueueStatus, storeReference, storeReferenceTransactional, storeRole, storeSecuritySetting, storeUser, updateDeliveryCount, updateDuplicateIDTransactional, updatePageTransaction, updateQueueBinding, updateScheduledDeliveryTime, updateScheduledDeliveryTimeTransactional, waitOnOperations, waitOnOperations, writeLock, writeUnlockMethods inherited from class org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
checkExpiration, getCriticalAnalyzer, measureCriticalMethods 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.persistence.StorageManager
closeableReadLock, createFileForLargeMessage, loadMessageJournal, loadMessageJournal
-
Field Details
-
ACTIVEMQ_DATA
- See Also:
-
journalFF
-
bindingsFF
-
largeMessagesFactory
-
originalMessageJournal
-
originalBindingsJournal
-
largeMessagesDirectory
-
replicator
-
-
Constructor Details
-
JournalStorageManager
public JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutors) -
JournalStorageManager
public JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ExecutorFactory ioExecutors) -
JournalStorageManager
public JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ScheduledExecutorService scheduledExecutorService, ExecutorFactory ioExecutors, IOCriticalErrorListener criticalErrorListener) -
JournalStorageManager
public JournalStorageManager(Configuration config, CriticalAnalyzer analyzer, ExecutorFactory executorFactory, ExecutorFactory ioExecutors, IOCriticalErrorListener criticalErrorListener)
-
-
Method Details
-
getUsedConnections
-
getJournalSequentialFileFactory
-
init
Description copied from class:AbstractJournalStorageManagerCalled during initialization. Used by implementations to setup Journals, Stores etc...- Specified by:
initin classAbstractJournalStorageManager
-
fixJournalFileSize
protected int fixJournalFileSize(int fileSize, int alignment) We need to correct the file size if its not a multiple of the alignement- Parameters:
fileSize- : the configured file size.alignment- : the alignment.- Returns:
- the fixed file size
-
createMessageJournal
protected Journal createMessageJournal(Configuration config, IOCriticalErrorListener criticalErrorListener, int fileSize) -
beforeStart
- Specified by:
beforeStartin classAbstractJournalStorageManager- Throws:
Exception
-
createDirectories
protected void createDirectories() -
beforeStop
- Specified by:
beforeStopin classAbstractJournalStorageManager- Throws:
Exception
-
stop
- Specified by:
stopin interfaceActiveMQComponent- Overrides:
stopin classAbstractJournalStorageManager- Throws:
Exception
-
isReplicated
public boolean isReplicated() -
stop
Description copied from interface:StorageManagerStop thisStorageManager- Specified by:
stopin interfaceStorageManager- Overrides:
stopin classAbstractJournalStorageManager- 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
-
performCachedLargeMessageDeletes
protected void performCachedLargeMessageDeletes()Assumption is that this is only called with a writeLock on the StorageManager.- Specified by:
performCachedLargeMessageDeletesin classAbstractJournalStorageManager
-
parseLargeMessage
- Specified by:
parseLargeMessagein classAbstractJournalStorageManager- Throws:
Exception
-
pageClosed
-
pageDeleted
-
pageWrite
public void pageWrite(SimpleString address, PagedMessage message, long pageNumber, boolean storageUp, boolean originallyReplicated) -
allocateDirectBuffer
Description copied from interface:StorageManagerAIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC. These methods will use that buffer if the inner method supports it -
freeDirectBuffer
Description copied from interface:StorageManagerAIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC. These methods will use that buffer if the inner method supports it -
largeMessageClosed
- Throws:
ActiveMQException
-
deleteLargeMessageBody
- Throws:
ActiveMQException
-
createCoreLargeMessage
-
createCoreLargeMessage
Description copied from interface:StorageManagerCreates a new LargeServerMessage for the core Protocol with the given id.message- This is a temporary message that holds the parsed properties. The remoting layer can't create a ServerMessage directly, then this will be replaced.- Returns:
- a large message object
- Throws:
Exception
-
onLargeMessageCreate
public LargeServerMessage onLargeMessageCreate(long id, LargeServerMessage largeMessage) throws Exception Description copied from interface:StorageManagerOther protocols may inform the storage manager when a large message was created.- Throws:
Exception
-
createFileForLargeMessage
public SequentialFile createFileForLargeMessage(long messageID, StorageManager.LargeMessageExtension extension) Description copied from interface:StorageManagerInstantiates a SequentialFile to be used for storing aLargeServerMessage.- Parameters:
messageID- the id of the messageextension- the extension to add to the file
-
startReplication
public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, boolean autoFailBack, long initialReplicationSyncTimeout) throws Exception - Throws:
Exception
-
recoverLargeMessagesOnFolder
- Throws:
Exception
-
stopReplication
public void stopReplication()Stops replication by resetting replication-related fields to their 'unreplicated' state. -
addBytesToLargeMessage
public void addBytesToLargeMessage(SequentialFile file, long messageId, ActiveMQBuffer bytes) throws Exception - Throws:
Exception
-
addBytesToLargeMessage
public void addBytesToLargeMessage(SequentialFile file, long messageId, byte[] bytes) throws Exception - Throws:
Exception
-
injectMonitor
- Throws:
Exception
-
getAllowedPageSize
public int getAllowedPageSize(int pageSize)
-