public interface StorageManager extends IDGenerator, ActiveMQComponent
| Modifier and Type | Interface and Description |
|---|---|
static class |
StorageManager.LargeMessageExtension |
| Modifier and Type | Method and Description |
|---|---|
void |
addBytesToLargeMessage(SequentialFile appendFile,
long messageID,
byte[] bytes) |
void |
addGrouping(GroupBinding groupBinding) |
void |
addQueueBinding(long tx,
Binding binding) |
boolean |
addToPage(PagingStore store,
ServerMessage msg,
Transaction tx,
RouteContextList listCtx)
Write message to page if we are paging.
|
void |
afterCompleteOperations(IOCallback run) |
void |
afterPageRead()
We need a safeguard in place to avoid too much concurrent IO happening on Paging, otherwise
the system may become unresponsive if too many destinations are reading all the same time.
|
void |
afterStoreOperations(IOCallback run)
This is similar to afterComplete, however this only cares about the journal part.
|
ByteBuffer |
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.
|
void |
beforePageRead()
We need a safeguard in place to avoid too much concurrent IO happening on Paging, otherwise
the system may become unresponsive if too many destinations are reading all the same time.
|
void |
clearContext() |
void |
commit(long txID) |
void |
commit(long txID,
boolean lineUpContext) |
void |
commitBindings(long txID) |
void |
confirmPendingLargeMessage(long recordID)
Confirms that a large message was finished
|
void |
confirmPendingLargeMessageTX(Transaction transaction,
long messageID,
long recordID)
Confirms that a large message was finished
|
SequentialFile |
createFileForLargeMessage(long messageID,
StorageManager.LargeMessageExtension extension)
Instantiates a SequentialFile to be used for storing a
LargeServerMessage. |
LargeServerMessage |
createLargeMessage() |
LargeServerMessage |
createLargeMessage(long id,
MessageInternal message)
Creates a new LargeMessage with the given id.
|
void |
criticalError(Throwable error) |
void |
deleteAddressSetting(SimpleString addressMatch) |
void |
deleteCursorAcknowledge(long ackID) |
void |
deleteCursorAcknowledgeTransactional(long txID,
long ackID) |
void |
deleteDuplicateID(long recordID) |
void |
deleteDuplicateIDTransactional(long txID,
long recordID) |
void |
deleteGrouping(long tx,
GroupBinding groupBinding) |
void |
deleteHeuristicCompletion(long id) |
void |
deleteID(long journalD) |
void |
deleteIncrementRecord(long txID,
long recordID) |
void |
deleteMessage(long messageID) |
void |
deletePageComplete(long ackID) |
void |
deletePageCounter(long txID,
long recordID) |
void |
deletePageTransactional(long recordID) |
void |
deletePendingPageCounter(long txID,
long recordID) |
void |
deleteQueueBinding(long tx,
long queueBindingID) |
void |
deleteQueueStatus(long recordID) |
void |
deleteSecurityRoles(SimpleString addressMatch) |
void |
freeDirectBuffer(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.
|
Journal |
getBindingsJournal() |
OperationContext |
getContext()
Get the context associated with the thread for later reuse
|
Journal |
getMessageJournal() |
void |
injectMonitor(FileStoreMonitor monitor) |
void |
lineUpContext() |
JournalLoadInformation |
loadBindingJournal(List<QueueBindingInfo> queueBindingInfos,
List<GroupingInfo> groupingInfos) |
JournalLoadInformation |
loadMessageJournal(PostOffice postOffice,
PagingManager pagingManager,
ResourceManager resourceManager,
Map<Long,QueueBindingInfo> queueInfos,
Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap,
Set<Pair<Long,Long>> pendingLargeMessages,
List<PageCountPending> pendingNonTXPageCounter,
JournalLoader journalLoader) |
OperationContext |
newContext(Executor executor)
It just creates an OperationContext without associating it
|
OperationContext |
newSingleThreadContext() |
void |
pageClosed(SimpleString storeName,
int pageNumber) |
void |
pageDeleted(SimpleString storeName,
int pageNumber) |
void |
pageWrite(PagedMessage message,
int pageNumber) |
void |
persistIdGenerator()
Closes the
IDGenerator persisting the current record ID. |
void |
prepare(long txID,
Xid xid) |
void |
readLock()
Read lock the StorageManager.
|
void |
readUnLock()
Unlock the manager.
|
List<PersistedAddressSetting> |
recoverAddressSettings() |
List<PersistedRoles> |
recoverPersistedRoles() |
void |
rollback(long txID) |
void |
rollbackBindings(long txID) |
void |
setContext(OperationContext context)
Set the context back to the thread
|
void |
startReplication(ReplicationManager replicationManager,
PagingManager pagingManager,
String nodeID,
boolean autoFailBack,
long initialReplicationSyncTimeout) |
void |
stop(boolean ioCriticalError,
boolean sendFailover) |
void |
stopReplication()
Stops the replication of data from the live to the backup.
|
void |
storeAcknowledge(long queueID,
long messageID) |
void |
storeAcknowledgeTransactional(long txID,
long queueID,
long messageID) |
void |
storeAddressSetting(PersistedAddressSetting addressSetting) |
void |
storeCursorAcknowledge(long queueID,
PagePosition position) |
void |
storeCursorAcknowledgeTransactional(long txID,
long queueID,
PagePosition position) |
void |
storeDuplicateID(SimpleString address,
byte[] duplID,
long recordID) |
void |
storeDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID) |
long |
storeHeuristicCompletion(Xid xid,
boolean isCommit) |
void |
storeID(long journalID,
long id)
Stores the id from IDManager.
|
void |
storeMessage(ServerMessage message) |
void |
storeMessageTransactional(long txID,
ServerMessage message) |
void |
storePageCompleteTransactional(long txID,
long queueID,
PagePosition position) |
long |
storePageCounter(long txID,
long queueID,
long value) |
long |
storePageCounterInc(long queueID,
int add) |
long |
storePageCounterInc(long txID,
long queueID,
int add) |
void |
storePageTransaction(long txID,
PageTransactionInfo pageTransaction) |
long |
storePendingCounter(long queueID,
long pageID,
int inc) |
long |
storeQueueStatus(long queueID,
QueueStatus status) |
void |
storeReference(long queueID,
long messageID,
boolean last) |
void |
storeReferenceTransactional(long txID,
long queueID,
long messageID) |
void |
storeSecurityRoles(PersistedRoles persistedRoles) |
void |
updateDeliveryCount(MessageReference ref) |
void |
updateDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID) |
void |
updatePageTransaction(long txID,
PageTransactionInfo pageTransaction,
int depage) |
void |
updatePageTransaction(PageTransactionInfo pageTransaction,
int depage)
FIXME Unused
|
void |
updateScheduledDeliveryTime(MessageReference ref) |
void |
updateScheduledDeliveryTimeTransactional(long txID,
MessageReference ref) |
void |
waitOnOperations()
Block until the operations are done.
|
boolean |
waitOnOperations(long timeout)
Block until the operations are done.
|
generateID, getCurrentIDisStarted, start, stopvoid criticalError(Throwable error)
OperationContext getContext()
void lineUpContext()
OperationContext newContext(Executor executor)
OperationContext newSingleThreadContext()
void setContext(OperationContext context)
void stop(boolean ioCriticalError,
boolean sendFailover)
throws Exception
ioCriticalError - is the server being stopped due to an IO critical error.sendFailover - this is to send the replication stopping in case of replication.Exceptionvoid pageClosed(SimpleString storeName, int pageNumber)
void pageDeleted(SimpleString storeName, int pageNumber)
void pageWrite(PagedMessage message, int pageNumber)
void afterCompleteOperations(IOCallback run)
void afterStoreOperations(IOCallback run)
boolean waitOnOperations(long timeout)
throws Exception
Exceptionvoid waitOnOperations()
throws Exception
Exceptionvoid beforePageRead()
throws Exception
Exceptionvoid afterPageRead()
throws Exception
ExceptionByteBuffer allocateDirectBuffer(int size)
void freeDirectBuffer(ByteBuffer buffer)
void clearContext()
void confirmPendingLargeMessageTX(Transaction transaction, long messageID, long recordID) throws Exception
Exceptionvoid confirmPendingLargeMessage(long recordID)
throws Exception
Exceptionvoid storeMessage(ServerMessage message) throws Exception
Exceptionvoid storeReference(long queueID,
long messageID,
boolean last)
throws Exception
Exceptionvoid storeAcknowledge(long queueID,
long messageID)
throws Exception
Exceptionvoid storeCursorAcknowledge(long queueID,
PagePosition position)
throws Exception
Exceptionvoid updateDeliveryCount(MessageReference ref) throws Exception
Exceptionvoid updateScheduledDeliveryTime(MessageReference ref) throws Exception
Exceptionvoid storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
Exceptionvoid storeMessageTransactional(long txID,
ServerMessage message)
throws Exception
Exceptionvoid storeReferenceTransactional(long txID,
long queueID,
long messageID)
throws Exception
Exceptionvoid storeAcknowledgeTransactional(long txID,
long queueID,
long messageID)
throws Exception
Exceptionvoid storeCursorAcknowledgeTransactional(long txID,
long queueID,
PagePosition position)
throws Exception
Exceptionvoid deleteCursorAcknowledgeTransactional(long txID,
long ackID)
throws Exception
Exceptionvoid storePageCompleteTransactional(long txID,
long queueID,
PagePosition position)
throws Exception
Exceptionvoid updateScheduledDeliveryTimeTransactional(long txID,
MessageReference ref)
throws Exception
Exceptionvoid storeDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID)
throws Exception
Exceptionvoid updateDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID)
throws Exception
Exceptionvoid deleteDuplicateIDTransactional(long txID,
long recordID)
throws Exception
ExceptionLargeServerMessage createLargeMessage()
LargeServerMessage createLargeMessage(long id, MessageInternal message) throws Exception
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.ExceptionSequentialFile createFileForLargeMessage(long messageID, StorageManager.LargeMessageExtension extension)
LargeServerMessage.messageID - the id of the messageextension - the extension to add to the filevoid storePageTransaction(long txID,
PageTransactionInfo pageTransaction)
throws Exception
Exceptionvoid updatePageTransaction(long txID,
PageTransactionInfo pageTransaction,
int depage)
throws Exception
Exceptionvoid updatePageTransaction(PageTransactionInfo pageTransaction, int depage) throws Exception
Exceptionvoid deletePageTransactional(long recordID)
throws Exception
ExceptionJournalLoadInformation loadMessageJournal(PostOffice postOffice, PagingManager pagingManager, ResourceManager resourceManager, Map<Long,QueueBindingInfo> queueInfos, Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap, Set<Pair<Long,Long>> pendingLargeMessages, List<PageCountPending> pendingNonTXPageCounter, JournalLoader journalLoader) throws Exception
Exceptionlong storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
Exceptionvoid deleteHeuristicCompletion(long id)
throws Exception
Exceptionvoid deleteQueueBinding(long tx,
long queueBindingID)
throws Exception
Exceptionlong storeQueueStatus(long queueID,
QueueStatus status)
throws Exception
queueID - The id of the queuestatus - The current status of the queue. (Reserved for future use, ATM we only use this record for PAUSED)ExceptionJournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
Exceptionvoid addGrouping(GroupBinding groupBinding) throws Exception
Exceptionvoid deleteGrouping(long tx,
GroupBinding groupBinding)
throws Exception
Exceptionvoid storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
Exceptionvoid deleteAddressSetting(SimpleString addressMatch) throws Exception
ExceptionList<PersistedAddressSetting> recoverAddressSettings() throws Exception
Exceptionvoid storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
Exceptionvoid deleteSecurityRoles(SimpleString addressMatch) throws Exception
ExceptionList<PersistedRoles> recoverPersistedRoles() throws Exception
Exceptionlong storePageCounter(long txID,
long queueID,
long value)
throws Exception
Exceptionlong storePendingCounter(long queueID,
long pageID,
int inc)
throws Exception
Exceptionvoid deleteIncrementRecord(long txID,
long recordID)
throws Exception
Exceptionvoid deletePageCounter(long txID,
long recordID)
throws Exception
Exceptionvoid deletePendingPageCounter(long txID,
long recordID)
throws Exception
Exceptionlong storePageCounterInc(long txID,
long queueID,
int add)
throws Exception
Exceptionlong storePageCounterInc(long queueID,
int add)
throws Exception
ExceptionJournal getBindingsJournal()
Journal getMessageJournal()
void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, boolean autoFailBack, long initialReplicationSyncTimeout) throws Exception
boolean addToPage(PagingStore store, ServerMessage msg, Transaction tx, RouteContextList listCtx) throws Exception
This is primarily a PagingStore call, but as with any other call writing persistent
data, it must go through here. Both for the sake of replication, and also to ensure that it
takes the locks (storage manager and pagingStore) in the right order. Avoiding thus the
creation of dead-locks.
true if we are paging and have handled the data, false if the data
needs to be sent to the journalExceptionvoid stopReplication()
Typical scenario is a broken connection.
void addBytesToLargeMessage(SequentialFile appendFile, long messageID, byte[] bytes) throws Exception
appendFile - messageID - bytes - Exceptionvoid storeID(long journalID,
long id)
throws Exception
journalID - id - Exceptionvoid readLock()
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.
void readUnLock()
readLock()void persistIdGenerator()
IDGenerator persisting the current record ID.
Effectively a "pre-stop" method. Necessary due to the "stop"-order at
ActiveMQServerImpl
void injectMonitor(FileStoreMonitor monitor) throws Exception
ExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.