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 s,
ServerMessage msg,
Transaction tx,
RouteContextList listCtx)
Write message to page if we are paging.
|
void |
afterCompleteOperations(IOAsyncTask 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(IOAsyncTask 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 |
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 |
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 |
generateUniqueID() |
Journal |
getBindingsJournal() |
OperationContext |
getContext()
Get the context associated with the thread for later reuse
|
long |
getCurrentUniqueID() |
SequentialFileFactory |
getJournalSequentialFileFactory() |
Journal |
getMessageJournal() |
boolean |
isStarted() |
void |
lineUpContext() |
JournalLoadInformation |
loadBindingJournal(List<QueueBindingInfo> queueBindingInfos,
List<GroupingInfo> groupingInfos) |
JournalLoadInformation |
loadMessageJournal(PostOffice postOffice,
PagingManager pagingManager,
ResourceManager resourceManager,
Map<Long,Queue> queues,
Map<Long,QueueBindingInfo> queueInfos,
Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap,
Set<Pair<Long,Long>> pendingLargeMessages,
List<PageCountPending> pendingNonTXPageCounter) |
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) |
void |
stop() |
void |
stop(boolean ioCriticalError,
boolean sendReplication) |
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 given journalID in the bindingsJournal.
|
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) |
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 SequentialFileFactory getJournalSequentialFileFactory()
getJournalSequentialFileFactory
in interface StorageManager
public void criticalError(Throwable error)
criticalError
in interface StorageManager
public void deleteQueueBinding(long tx, long queueBindingID) throws Exception
deleteQueueBinding
in interface StorageManager
Exception
public void commit(long txID) throws Exception
commit
in interface StorageManager
Exception
public JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
loadBindingJournal
in interface StorageManager
Exception
public void prepare(long txID, Xid xid) throws Exception
prepare
in interface StorageManager
Exception
public void rollback(long txID) throws Exception
rollback
in interface StorageManager
Exception
public void rollbackBindings(long txID) throws Exception
rollbackBindings
in interface StorageManager
Exception
public void commitBindings(long txID) throws Exception
commitBindings
in interface StorageManager
Exception
public void storeReference(long queueID, long messageID, boolean last) throws Exception
storeReference
in interface StorageManager
Exception
public void storeReferenceTransactional(long txID, long queueID, long messageID) throws Exception
storeReferenceTransactional
in interface StorageManager
Exception
public void storeAcknowledge(long queueID, long messageID) throws Exception
storeAcknowledge
in interface StorageManager
Exception
public void storeAcknowledgeTransactional(long txID, long queueID, long messageiD) throws Exception
storeAcknowledgeTransactional
in interface StorageManager
Exception
public void deleteMessage(long messageID) throws Exception
deleteMessage
in interface StorageManager
Exception
public void storeMessage(ServerMessage message) throws Exception
storeMessage
in interface StorageManager
Exception
public void storeMessageTransactional(long txID, ServerMessage message) throws Exception
storeMessageTransactional
in interface StorageManager
Exception
public void updateScheduledDeliveryTime(MessageReference ref) throws Exception
updateScheduledDeliveryTime
in interface StorageManager
Exception
public void updateScheduledDeliveryTimeTransactional(long txID, MessageReference ref) throws Exception
updateScheduledDeliveryTimeTransactional
in interface StorageManager
Exception
public void storePageTransaction(long txID, PageTransactionInfo pageTransaction) throws Exception
storePageTransaction
in interface StorageManager
Exception
public void updateDeliveryCount(MessageReference ref) throws Exception
updateDeliveryCount
in interface StorageManager
Exception
public void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
storeDuplicateID
in interface StorageManager
Exception
public void storeDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception
storeDuplicateIDTransactional
in interface StorageManager
Exception
public void updateDuplicateIDTransactional(long txID, SimpleString address, byte[] duplID, long recordID) throws Exception
updateDuplicateIDTransactional
in interface StorageManager
Exception
public long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
storeHeuristicCompletion
in interface StorageManager
Exception
public void deleteHeuristicCompletion(long txID) throws Exception
deleteHeuristicCompletion
in interface StorageManager
Exception
public void addQueueBinding(long tx, Binding binding) throws Exception
addQueueBinding
in interface StorageManager
Exception
public LargeServerMessage createLargeMessage()
createLargeMessage
in interface StorageManager
public LargeServerMessage createLargeMessage(long id, MessageInternal message)
StorageManager
createLargeMessage
in interface StorageManager
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.public long generateUniqueID()
generateUniqueID
in interface StorageManager
public long getCurrentUniqueID()
getCurrentUniqueID
in interface StorageManager
public void start() throws Exception
start
in interface HornetQComponent
Exception
public void stop() throws Exception
stop
in interface HornetQComponent
Exception
public boolean isStarted()
isStarted
in interface HornetQComponent
public JournalLoadInformation loadMessageJournal(PostOffice postOffice, PagingManager pagingManager, ResourceManager resourceManager, Map<Long,Queue> queues, Map<Long,QueueBindingInfo> queueInfos, Map<SimpleString,List<Pair<byte[],Long>>> duplicateIDMap, Set<Pair<Long,Long>> pendingLargeMessages, List<PageCountPending> pendingNonTXPageCounter) throws Exception
loadMessageJournal
in interface StorageManager
Exception
public void deleteDuplicateIDTransactional(long txID, long recordID) throws Exception
deleteDuplicateIDTransactional
in interface StorageManager
Exception
public void deleteDuplicateID(long recordID) throws Exception
deleteDuplicateID
in interface StorageManager
Exception
public void pageClosed(SimpleString storeName, int pageNumber)
pageClosed
in interface StorageManager
public void pageDeleted(SimpleString storeName, int pageNumber)
pageDeleted
in interface StorageManager
public void pageWrite(PagedMessage message, int pageNumber)
pageWrite
in interface StorageManager
public void addGrouping(GroupBinding groupBinding) throws Exception
addGrouping
in interface StorageManager
Exception
public void deleteGrouping(long tx, GroupBinding groupBinding) throws Exception
deleteGrouping
in interface StorageManager
Exception
public boolean waitOnOperations(long timeout) throws Exception
StorageManager
waitOnOperations
in interface StorageManager
Exception
public void afterCompleteOperations(IOAsyncTask run)
afterCompleteOperations
in interface StorageManager
public void afterStoreOperations(IOAsyncTask run)
StorageManager
afterStoreOperations
in interface StorageManager
public void waitOnOperations() throws Exception
StorageManager
waitOnOperations
in interface StorageManager
Exception
public OperationContext getContext()
StorageManager
getContext
in interface StorageManager
public OperationContext newContext(Executor executor)
StorageManager
newContext
in interface StorageManager
public OperationContext newSingleThreadContext()
newSingleThreadContext
in interface StorageManager
public void setContext(OperationContext context)
StorageManager
setContext
in interface StorageManager
public void clearContext()
clearContext
in interface StorageManager
public List<PersistedAddressSetting> recoverAddressSettings() throws Exception
recoverAddressSettings
in interface StorageManager
Exception
public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
storeAddressSetting
in interface StorageManager
Exception
public List<PersistedRoles> recoverPersistedRoles() throws Exception
recoverPersistedRoles
in interface StorageManager
Exception
public void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
storeSecurityRoles
in interface StorageManager
Exception
public void deleteAddressSetting(SimpleString addressMatch) throws Exception
deleteAddressSetting
in interface StorageManager
Exception
public void deleteSecurityRoles(SimpleString addressMatch) throws Exception
deleteSecurityRoles
in interface StorageManager
Exception
public void deletePageTransactional(long recordID) throws Exception
deletePageTransactional
in interface StorageManager
Exception
public void updatePageTransaction(long txID, PageTransactionInfo pageTransaction, int depage) throws Exception
updatePageTransaction
in interface StorageManager
Exception
public void storeCursorAcknowledge(long queueID, PagePosition position)
storeCursorAcknowledge
in interface StorageManager
public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position)
storeCursorAcknowledgeTransactional
in interface StorageManager
public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception
deleteCursorAcknowledgeTransactional
in interface StorageManager
Exception
public void deleteCursorAcknowledge(long ackID) throws Exception
deleteCursorAcknowledge
in interface StorageManager
Exception
public void storePageCompleteTransactional(long txID, long queueID, PagePosition position) throws Exception
storePageCompleteTransactional
in interface StorageManager
Exception
public void deletePageComplete(long ackID) throws Exception
deletePageComplete
in interface StorageManager
Exception
public void updatePageTransaction(PageTransactionInfo pageTransaction, int depage) throws Exception
StorageManager
updatePageTransaction
in interface StorageManager
Exception
public long storePageCounter(long txID, long queueID, long value) throws Exception
storePageCounter
in interface StorageManager
Exception
public long storePendingCounter(long queueID, long pageID, int inc) throws Exception
storePendingCounter
in interface StorageManager
Exception
public void deleteIncrementRecord(long txID, long recordID) throws Exception
deleteIncrementRecord
in interface StorageManager
Exception
public void deletePageCounter(long txID, long recordID) throws Exception
deletePageCounter
in interface StorageManager
Exception
public void deletePendingPageCounter(long txID, long recordID) throws Exception
deletePendingPageCounter
in interface StorageManager
Exception
public long storePageCounterInc(long txID, long queueID, int add) throws Exception
storePageCounterInc
in interface StorageManager
Exception
public long storePageCounterInc(long queueID, int add) throws Exception
storePageCounterInc
in interface StorageManager
Exception
public void commit(long txID, boolean lineUpContext) throws Exception
commit
in interface StorageManager
Exception
public void lineUpContext()
lineUpContext
in interface StorageManager
public void confirmPendingLargeMessageTX(Transaction transaction, long messageID, long recordID) throws Exception
StorageManager
confirmPendingLargeMessageTX
in interface StorageManager
Exception
public void confirmPendingLargeMessage(long recordID) throws Exception
StorageManager
confirmPendingLargeMessage
in interface StorageManager
Exception
public void stop(boolean ioCriticalError, boolean sendReplication) throws Exception
stop
in interface StorageManager
ioCriticalError
- is the server being stopped due to an IO critical error.sendReplication
- this is to send the replication stopping in case of replication.Exception
public Journal getBindingsJournal()
getBindingsJournal
in interface StorageManager
public Journal getMessageJournal()
getMessageJournal
in interface StorageManager
public void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, boolean autoFailBack) throws Exception
startReplication
in interface StorageManager
Exception
JournalStorageManager#startReplication(ReplicationManager, PagingManager, String,
boolean)
public boolean addToPage(PagingStore s, ServerMessage msg, Transaction tx, RouteContextList listCtx) throws Exception
StorageManager
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 StorageManager
true
if we are paging and have handled the data, false
if the data
needs to be sent to the journalException
public void stopReplication()
StorageManager
stopReplication
in interface StorageManager
public SequentialFile createFileForLargeMessage(long messageID, StorageManager.LargeMessageExtension extension)
StorageManager
LargeServerMessage
.createFileForLargeMessage
in interface StorageManager
messageID
- 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 StorageManager
Exception
public void beforePageRead() throws Exception
StorageManager
beforePageRead
in interface StorageManager
Exception
public void afterPageRead() throws Exception
StorageManager
afterPageRead
in interface StorageManager
Exception
public ByteBuffer allocateDirectBuffer(int size)
StorageManager
allocateDirectBuffer
in interface StorageManager
public void freeDirectBuffer(ByteBuffer buffer)
StorageManager
freeDirectBuffer
in interface StorageManager
public void storeID(long journalID, long id) throws Exception
StorageManager
storeID
in interface StorageManager
Exception
public void readLock()
StorageManager
readLock
in interface StorageManager
public void readUnLock()
StorageManager
readUnLock
in interface StorageManager
StorageManager.readLock()
public void persistIdGenerator()
StorageManager
IDGenerator
persisting the current record ID.
Effectively a "pre-stop" method. Necessary due to the "stop"-order at
HornetQServerImpl
persistIdGenerator
in interface StorageManager
Copyright © 2018 JBoss by Red Hat. All rights reserved.