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, getCurrentID
isStarted, start, stop
void 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.Exception
void 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
Exception
void waitOnOperations() throws Exception
Exception
void beforePageRead() throws Exception
Exception
void afterPageRead() throws Exception
Exception
ByteBuffer allocateDirectBuffer(int size)
void freeDirectBuffer(ByteBuffer buffer)
void clearContext()
void confirmPendingLargeMessageTX(Transaction transaction, long messageID, long recordID) throws Exception
Exception
void confirmPendingLargeMessage(long recordID) throws Exception
Exception
void storeMessage(ServerMessage message) throws Exception
Exception
void storeReference(long queueID, long messageID, boolean last) throws Exception
Exception
void storeAcknowledge(long queueID, long messageID) throws Exception
Exception
void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception
Exception
void updateDeliveryCount(MessageReference ref) throws Exception
Exception
void updateScheduledDeliveryTime(MessageReference ref) throws Exception
Exception
void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
Exception
void storeMessageTransactional(long txID, ServerMessage message) throws Exception
Exception
void storeReferenceTransactional(long txID, long queueID, long messageID) throws Exception
Exception
void storeAcknowledgeTransactional(long txID, long queueID, long messageID) throws Exception
Exception
void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception
Exception
void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception
Exception
void storePageCompleteTransactional(long txID, long queueID, PagePosition position) throws Exception
Exception
void updateScheduledDeliveryTimeTransactional(long txID, MessageReference ref) throws Exception
Exception
void storeDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception
Exception
void updateDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception
Exception
void deleteDuplicateIDTransactional(long txID, long recordID) throws Exception
Exception
LargeServerMessage 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.Exception
SequentialFile 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
Exception
void updatePageTransaction(long txID, PageTransactionInfo pageTransaction, int depage) throws Exception
Exception
void updatePageTransaction(PageTransactionInfo pageTransaction, int depage) throws Exception
Exception
void deletePageTransactional(long recordID) throws Exception
Exception
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) throws Exception
Exception
long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
Exception
void deleteHeuristicCompletion(long id) throws Exception
Exception
void deleteQueueBinding(long tx, long queueBindingID) throws Exception
Exception
long 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)Exception
JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
Exception
void addGrouping(GroupBinding groupBinding) throws Exception
Exception
void deleteGrouping(long tx, GroupBinding groupBinding) throws Exception
Exception
void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
Exception
void deleteAddressSetting(SimpleString addressMatch) throws Exception
Exception
List<PersistedAddressSetting> recoverAddressSettings() throws Exception
Exception
void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
Exception
void deleteSecurityRoles(SimpleString addressMatch) throws Exception
Exception
List<PersistedRoles> recoverPersistedRoles() throws Exception
Exception
long storePageCounter(long txID, long queueID, long value) throws Exception
Exception
long storePendingCounter(long queueID, long pageID, int inc) throws Exception
Exception
void deleteIncrementRecord(long txID, long recordID) throws Exception
Exception
void deletePageCounter(long txID, long recordID) throws Exception
Exception
void deletePendingPageCounter(long txID, long recordID) throws Exception
Exception
long storePageCounterInc(long txID, long queueID, int add) throws Exception
Exception
long storePageCounterInc(long queueID, int add) throws Exception
Exception
Journal 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 journalException
void stopReplication()
Typical scenario is a broken connection.
void addBytesToLargeMessage(SequentialFile appendFile, long messageID, byte[] bytes) throws Exception
appendFile
- messageID
- bytes
- Exception
void storeID(long journalID, long id) throws Exception
journalID
- id
- Exception
void 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
Exception
Copyright © 2017 JBoss by Red Hat. All rights reserved.