public class NullStorageManager extends Object implements StorageManager
StorageManager.LargeMessageExtension| Constructor and Description |
|---|
NullStorageManager() |
NullStorageManager(IOCriticalErrorListener ioCriticalErrorListener) |
| 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 txID) |
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.
|
long |
generateID() |
Journal |
getBindingsJournal() |
OperationContext |
getContext()
Get the context associated with the thread for later reuse
|
long |
getCurrentID() |
Journal |
getMessageJournal() |
void |
injectMonitor(FileStoreMonitor monitor) |
boolean |
isStarted() |
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 |
start() |
void |
startReplication(ReplicationManager replicationManager,
PagingManager pagingManager,
String nodeID,
boolean autoFailBack,
long initialReplicationSyncTimeout) |
void |
stop() |
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.
|
public NullStorageManager(IOCriticalErrorListener ioCriticalErrorListener)
public NullStorageManager()
public void criticalError(Throwable error)
criticalError in interface StorageManagerpublic long storeQueueStatus(long queueID,
QueueStatus status)
throws Exception
storeQueueStatus in interface StorageManagerqueueID - The id of the queuestatus - The current status of the queue. (Reserved for future use, ATM we only use this record for PAUSED)Exceptionpublic void deleteQueueStatus(long recordID)
throws Exception
deleteQueueStatus in interface StorageManagerExceptionpublic void injectMonitor(FileStoreMonitor monitor) throws Exception
injectMonitor in interface StorageManagerExceptionpublic void deleteQueueBinding(long tx,
long queueBindingID)
throws Exception
deleteQueueBinding in interface StorageManagerExceptionpublic void commit(long txID)
throws Exception
commit in interface StorageManagerExceptionpublic JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
loadBindingJournal in interface StorageManagerExceptionpublic void prepare(long txID,
Xid xid)
throws Exception
prepare in interface StorageManagerExceptionpublic void rollback(long txID)
throws Exception
rollback in interface StorageManagerExceptionpublic void rollbackBindings(long txID)
throws Exception
rollbackBindings in interface StorageManagerExceptionpublic void commitBindings(long txID)
throws Exception
commitBindings in interface StorageManagerExceptionpublic void storeReference(long queueID,
long messageID,
boolean last)
throws Exception
storeReference in interface StorageManagerExceptionpublic void storeReferenceTransactional(long txID,
long queueID,
long messageID)
throws Exception
storeReferenceTransactional in interface StorageManagerExceptionpublic void storeAcknowledge(long queueID,
long messageID)
throws Exception
storeAcknowledge in interface StorageManagerExceptionpublic void storeAcknowledgeTransactional(long txID,
long queueID,
long messageiD)
throws Exception
storeAcknowledgeTransactional in interface StorageManagerExceptionpublic void deleteMessage(long messageID)
throws Exception
deleteMessage in interface StorageManagerExceptionpublic void storeMessage(ServerMessage message) throws Exception
storeMessage in interface StorageManagerExceptionpublic void storeMessageTransactional(long txID,
ServerMessage message)
throws Exception
storeMessageTransactional in interface StorageManagerExceptionpublic void updateScheduledDeliveryTime(MessageReference ref) throws Exception
updateScheduledDeliveryTime in interface StorageManagerExceptionpublic void updateScheduledDeliveryTimeTransactional(long txID,
MessageReference ref)
throws Exception
updateScheduledDeliveryTimeTransactional in interface StorageManagerExceptionpublic void storePageTransaction(long txID,
PageTransactionInfo pageTransaction)
throws Exception
storePageTransaction in interface StorageManagerExceptionpublic void updateDeliveryCount(MessageReference ref) throws Exception
updateDeliveryCount in interface StorageManagerExceptionpublic void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
storeDuplicateID in interface StorageManagerExceptionpublic void storeDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID)
throws Exception
storeDuplicateIDTransactional in interface StorageManagerExceptionpublic void updateDuplicateIDTransactional(long txID,
SimpleString address,
byte[] duplID,
long recordID)
throws Exception
updateDuplicateIDTransactional in interface StorageManagerExceptionpublic long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
storeHeuristicCompletion in interface StorageManagerExceptionpublic void deleteHeuristicCompletion(long txID)
throws Exception
deleteHeuristicCompletion in interface StorageManagerExceptionpublic void addQueueBinding(long tx,
Binding binding)
throws Exception
addQueueBinding in interface StorageManagerExceptionpublic LargeServerMessage createLargeMessage()
createLargeMessage in interface StorageManagerpublic LargeServerMessage createLargeMessage(long id, MessageInternal message)
StorageManagercreateLargeMessage in interface StorageManagermessage - This is a temporary message that holds the parsed properties. The remoting
layer can't create a ServerMessage directly, then this will be replaced.public long generateID()
generateID in interface IDGeneratorpublic long getCurrentID()
getCurrentID in interface IDGeneratorpublic void start()
throws Exception
start in interface ActiveMQComponentExceptionpublic void stop()
throws Exception
stop in interface ActiveMQComponentExceptionpublic boolean isStarted()
isStarted in interface ActiveMQComponentpublic 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
loadMessageJournal in interface StorageManagerExceptionpublic void deleteDuplicateIDTransactional(long txID,
long recordID)
throws Exception
deleteDuplicateIDTransactional in interface StorageManagerExceptionpublic void deleteDuplicateID(long recordID)
throws Exception
deleteDuplicateID in interface StorageManagerExceptionpublic void pageClosed(SimpleString storeName, int pageNumber)
pageClosed in interface StorageManagerpublic void pageDeleted(SimpleString storeName, int pageNumber)
pageDeleted in interface StorageManagerpublic void pageWrite(PagedMessage message, int pageNumber)
pageWrite in interface StorageManagerpublic void addGrouping(GroupBinding groupBinding) throws Exception
addGrouping in interface StorageManagerExceptionpublic void deleteGrouping(long tx,
GroupBinding groupBinding)
throws Exception
deleteGrouping in interface StorageManagerExceptionpublic boolean waitOnOperations(long timeout)
throws Exception
StorageManagerwaitOnOperations in interface StorageManagerExceptionpublic void afterCompleteOperations(IOCallback run)
afterCompleteOperations in interface StorageManagerpublic void afterStoreOperations(IOCallback run)
StorageManagerafterStoreOperations in interface StorageManagerpublic void waitOnOperations()
throws Exception
StorageManagerwaitOnOperations in interface StorageManagerExceptionpublic OperationContext getContext()
StorageManagergetContext in interface StorageManagerpublic OperationContext newContext(Executor executor)
StorageManagernewContext in interface StorageManagerpublic OperationContext newSingleThreadContext()
newSingleThreadContext in interface StorageManagerpublic void setContext(OperationContext context)
StorageManagersetContext in interface StorageManagerpublic void clearContext()
clearContext in interface StorageManagerpublic List<PersistedAddressSetting> recoverAddressSettings() throws Exception
recoverAddressSettings in interface StorageManagerExceptionpublic void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
storeAddressSetting in interface StorageManagerExceptionpublic List<PersistedRoles> recoverPersistedRoles() throws Exception
recoverPersistedRoles in interface StorageManagerExceptionpublic void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
storeSecurityRoles in interface StorageManagerExceptionpublic void deleteAddressSetting(SimpleString addressMatch) throws Exception
deleteAddressSetting in interface StorageManagerExceptionpublic void deleteSecurityRoles(SimpleString addressMatch) throws Exception
deleteSecurityRoles in interface StorageManagerExceptionpublic void deletePageTransactional(long recordID)
throws Exception
deletePageTransactional in interface StorageManagerExceptionpublic void updatePageTransaction(long txID,
PageTransactionInfo pageTransaction,
int depage)
throws Exception
updatePageTransaction in interface StorageManagerExceptionpublic void storeCursorAcknowledge(long queueID,
PagePosition position)
storeCursorAcknowledge in interface StorageManagerpublic void storeCursorAcknowledgeTransactional(long txID,
long queueID,
PagePosition position)
storeCursorAcknowledgeTransactional in interface StorageManagerpublic void deleteCursorAcknowledgeTransactional(long txID,
long ackID)
throws Exception
deleteCursorAcknowledgeTransactional in interface StorageManagerExceptionpublic void deleteCursorAcknowledge(long ackID)
throws Exception
deleteCursorAcknowledge in interface StorageManagerExceptionpublic void storePageCompleteTransactional(long txID,
long queueID,
PagePosition position)
throws Exception
storePageCompleteTransactional in interface StorageManagerExceptionpublic void deletePageComplete(long ackID)
throws Exception
deletePageComplete in interface StorageManagerExceptionpublic void updatePageTransaction(PageTransactionInfo pageTransaction, int depage) throws Exception
StorageManagerupdatePageTransaction in interface StorageManagerExceptionpublic long storePageCounter(long txID,
long queueID,
long value)
throws Exception
storePageCounter in interface StorageManagerExceptionpublic long storePendingCounter(long queueID,
long pageID,
int inc)
throws Exception
storePendingCounter in interface StorageManagerExceptionpublic void deleteIncrementRecord(long txID,
long recordID)
throws Exception
deleteIncrementRecord in interface StorageManagerExceptionpublic void deletePageCounter(long txID,
long recordID)
throws Exception
deletePageCounter in interface StorageManagerExceptionpublic void deletePendingPageCounter(long txID,
long recordID)
throws Exception
deletePendingPageCounter in interface StorageManagerExceptionpublic long storePageCounterInc(long txID,
long queueID,
int add)
throws Exception
storePageCounterInc in interface StorageManagerExceptionpublic long storePageCounterInc(long queueID,
int add)
throws Exception
storePageCounterInc in interface StorageManagerExceptionpublic void commit(long txID,
boolean lineUpContext)
throws Exception
commit in interface StorageManagerExceptionpublic void lineUpContext()
lineUpContext in interface StorageManagerpublic void confirmPendingLargeMessageTX(Transaction transaction, long messageID, long recordID) throws Exception
StorageManagerconfirmPendingLargeMessageTX in interface StorageManagerExceptionpublic void confirmPendingLargeMessage(long recordID)
throws Exception
StorageManagerconfirmPendingLargeMessage in interface StorageManagerExceptionpublic void stop(boolean ioCriticalError,
boolean sendFailover)
throws Exception
stop in interface StorageManagerioCriticalError - is the server being stopped due to an IO critical error.sendFailover - this is to send the replication stopping in case of replication.Exceptionpublic Journal getBindingsJournal()
getBindingsJournal in interface StorageManagerpublic Journal getMessageJournal()
getMessageJournal in interface StorageManagerpublic void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, boolean autoFailBack, long initialReplicationSyncTimeout) throws Exception
public boolean addToPage(PagingStore store, ServerMessage msg, Transaction tx, RouteContextList listCtx) throws Exception
StorageManager
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.
addToPage in interface StorageManagertrue if we are paging and have handled the data, false if the data
needs to be sent to the journalExceptionpublic void stopReplication()
StorageManagerTypical scenario is a broken connection.
stopReplication in interface StorageManagerpublic SequentialFile createFileForLargeMessage(long messageID, StorageManager.LargeMessageExtension extension)
StorageManagerLargeServerMessage.createFileForLargeMessage in interface StorageManagermessageID - the id of the messageextension - the extension to add to the filepublic void addBytesToLargeMessage(SequentialFile appendFile, long messageID, byte[] bytes) throws Exception
addBytesToLargeMessage in interface StorageManagerExceptionpublic void beforePageRead()
throws Exception
StorageManagerbeforePageRead in interface StorageManagerExceptionpublic void afterPageRead()
throws Exception
StorageManagerafterPageRead in interface StorageManagerExceptionpublic ByteBuffer allocateDirectBuffer(int size)
StorageManagerallocateDirectBuffer in interface StorageManagerpublic void freeDirectBuffer(ByteBuffer buffer)
StorageManagerfreeDirectBuffer in interface StorageManagerpublic void storeID(long journalID,
long id)
throws Exception
StorageManagerstoreID in interface StorageManagerExceptionpublic void readLock()
StorageManagerThe 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.
readLock in interface StorageManagerpublic void readUnLock()
StorageManagerreadUnLock in interface StorageManagerStorageManager.readLock()public void persistIdGenerator()
StorageManagerIDGenerator persisting the current record ID.
Effectively a "pre-stop" method. Necessary due to the "stop"-order at
ActiveMQServerImpl
persistIdGenerator in interface StorageManagerpublic void deleteID(long journalD)
throws Exception
deleteID in interface StorageManagerExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.