public class JournalStorageManager extends Object implements StorageManager
| Modifier and Type | Field and Description |
|---|---|
static byte |
ACKNOWLEDGE_CURSOR |
static byte |
ACKNOWLEDGE_REF |
static byte |
ADD_LARGE_MESSAGE |
static byte |
ADD_LARGE_MESSAGE_PENDING |
static byte |
ADD_MESSAGE |
static byte |
ADD_REF |
static byte |
ADDRESS_SETTING_RECORD |
static byte |
DUPLICATE_ID |
static byte |
GROUP_RECORD |
static byte |
HEURISTIC_COMPLETION |
static byte |
ID_COUNTER_RECORD |
static byte |
PAGE_CURSOR_COUNTER_INC |
static byte |
PAGE_CURSOR_COUNTER_VALUE |
static byte |
PAGE_TRANSACTION |
static byte |
QUEUE_BINDING_RECORD |
static byte |
SECURITY_RECORD |
static byte |
SET_SCHEDULED_DELIVERY_TIME |
static byte |
UPDATE_DELIVERY_COUNT |
| Constructor and Description |
|---|
JournalStorageManager(Configuration config,
ExecutorFactory executorFactory) |
JournalStorageManager(Configuration config,
ExecutorFactory executorFactory,
IOCriticalErrorListener criticalErrorListener) |
JournalStorageManager(Configuration config,
ExecutorFactory executorFactory,
ReplicationManager replicator,
IOCriticalErrorListener criticalErrorListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBytesToLargeMessage(SequentialFile file,
long messageId,
byte[] bytes) |
void |
addGrouping(GroupBinding groupBinding) |
void |
addQueueBinding(long tx,
Binding binding) |
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 irrensponsive if too many destinations are reading all the same time.
|
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 irrensponsive 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)
We don't need messageID now but we are likely to need it we ever decide to support a database
|
void |
confirmPendingLargeMessageTX(Transaction tx,
long messageID,
long recordID) |
LargeServerMessage |
createLargeMessage() |
LargeServerMessage |
createLargeMessage(long id,
MessageInternal message) |
void |
deleteAddressSetting(SimpleString addressMatch) |
void |
deleteCursorAcknowledgeTransactional(long txID,
long ackID) |
void |
deleteDuplicateID(long recordID) |
void |
deleteDuplicateIDTransactional(long txID,
long recordID) |
void |
deleteGrouping(GroupBinding groupBinding) |
void |
deleteHeuristicCompletion(long id) |
void |
deleteIncrementRecord(long txID,
long recordID) |
void |
deleteMessage(long messageID) |
void |
deletePageCounter(long txID,
long recordID) |
void |
deletePageTransactional(long recordID) |
void |
deleteQueueBinding(long queueBindingID) |
void |
deleteSecurityRoles(SimpleString addressMatch) |
static void |
describeBindingJournal(String bindingsDir) |
protected static void |
describeJournal(SequentialFileFactory fileFactory,
JournalImpl journal) |
static void |
describeMessagesJournal(String messagesDir) |
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
|
protected OperationContext |
getContext(boolean sync) |
long |
getCurrentUniqueID() |
Journal |
getMessageJournal() |
Executor |
getSingleThreadExecutor() |
boolean |
isReplicated() |
boolean |
isStarted() |
void |
lineUpContext() |
JournalLoadInformation |
loadBindingJournal(List<QueueBindingInfo> queueBindingInfos,
List<GroupingInfo> groupingInfos) |
JournalLoadInformation[] |
loadInternalOnly()
This method is only useful at the backup side.
|
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) |
protected static PersistedAddressSetting |
newAddressEncoding(long id,
HornetQBuffer buffer) |
protected static JournalStorageManager.PersistentQueueBindingEncoding |
newBindingEncoding(long id,
HornetQBuffer buffer) |
OperationContext |
newContext(Executor executor)
It just creates an OperationContext without associating it
|
protected static JournalStorageManager.GroupingEncoding |
newGroupEncoding(long id,
HornetQBuffer buffer) |
static Object |
newObjectEncoding(RecordInfo info) |
static Object |
newObjectEncoding(RecordInfo info,
JournalStorageManager storageManager) |
protected static PersistedRoles |
newSecurityRecord(long id,
HornetQBuffer buffer) |
OperationContext |
newSingleThreadContext() |
void |
pageClosed(SimpleString storeName,
int pageNumber) |
void |
pageDeleted(SimpleString storeName,
int pageNumber) |
void |
pageWrite(PagedMessage message,
int pageNumber) |
void |
prepare(long txID,
Xid xid) |
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 |
stop() |
void |
stop(boolean ioCriticalError) |
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 |
storeMessage(ServerMessage message) |
void |
storeMessageTransactional(long txID,
ServerMessage message) |
long |
storePageCounter(long txID,
long queueID,
long value) |
long |
storePageCounterInc(long queueID,
int value) |
long |
storePageCounterInc(long txID,
long queueID,
int value) |
void |
storePageTransaction(long txID,
PageTransactionInfo pageTransaction) |
long |
storePendingLargeMessage(long messageID) |
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 depages) |
void |
updatePageTransaction(PageTransactionInfo pageTransaction,
int depages) |
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 static final byte GROUP_RECORD
public static final byte QUEUE_BINDING_RECORD
public static final byte ID_COUNTER_RECORD
public static final byte ADDRESS_SETTING_RECORD
public static final byte SECURITY_RECORD
public static final byte ADD_LARGE_MESSAGE_PENDING
public static final byte ADD_LARGE_MESSAGE
public static final byte ADD_MESSAGE
public static final byte ADD_REF
public static final byte ACKNOWLEDGE_REF
public static final byte UPDATE_DELIVERY_COUNT
public static final byte PAGE_TRANSACTION
public static final byte SET_SCHEDULED_DELIVERY_TIME
public static final byte DUPLICATE_ID
public static final byte HEURISTIC_COMPLETION
public static final byte ACKNOWLEDGE_CURSOR
public static final byte PAGE_CURSOR_COUNTER_VALUE
public static final byte PAGE_CURSOR_COUNTER_INC
public JournalStorageManager(Configuration config, ExecutorFactory executorFactory)
public JournalStorageManager(Configuration config, ExecutorFactory executorFactory, IOCriticalErrorListener criticalErrorListener)
public JournalStorageManager(Configuration config, ExecutorFactory executorFactory, ReplicationManager replicator, IOCriticalErrorListener criticalErrorListener)
public void clearContext()
clearContext in interface StorageManagerpublic boolean isReplicated()
isReplicated in interface StorageManagerpublic void waitOnOperations()
throws Exception
StorageManagerwaitOnOperations in interface StorageManagerExceptionpublic boolean waitOnOperations(long timeout)
throws Exception
StorageManagerwaitOnOperations 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 OperationContext getContext()
StorageManagergetContext in interface StorageManagerpublic void setContext(OperationContext context)
StorageManagersetContext in interface StorageManagerpublic Executor getSingleThreadExecutor()
public OperationContext newSingleThreadContext()
newSingleThreadContext in interface StorageManagerpublic OperationContext newContext(Executor executor)
StorageManagernewContext in interface StorageManagerpublic void afterCompleteOperations(IOAsyncTask run)
afterCompleteOperations in interface StorageManagerpublic long generateUniqueID()
generateUniqueID in interface StorageManagerpublic long getCurrentUniqueID()
getCurrentUniqueID in interface StorageManagerpublic LargeServerMessage createLargeMessage()
createLargeMessage in interface StorageManagerpublic void addBytesToLargeMessage(SequentialFile file, long messageId, byte[] bytes) throws Exception
Exceptionpublic LargeServerMessage createLargeMessage(long id, MessageInternal message) throws Exception
createLargeMessage 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.Exceptionpublic long storePendingLargeMessage(long messageID)
throws Exception
Exceptionpublic void confirmPendingLargeMessageTX(Transaction tx, long messageID, long recordID) throws Exception
confirmPendingLargeMessageTX in interface StorageManagerExceptionpublic void confirmPendingLargeMessage(long recordID)
throws Exception
confirmPendingLargeMessage in interface StorageManagerExceptionpublic void storeMessage(ServerMessage message) throws Exception
storeMessage in interface StorageManagerExceptionpublic void storeReference(long queueID,
long messageID,
boolean last)
throws Exception
storeReference in interface StorageManagerExceptionpublic void storeAcknowledge(long queueID,
long messageID)
throws Exception
storeAcknowledge in interface StorageManagerExceptionpublic void storeCursorAcknowledge(long queueID,
PagePosition position)
throws Exception
storeCursorAcknowledge in interface StorageManagerExceptionpublic void deleteMessage(long messageID)
throws Exception
deleteMessage in interface StorageManagerExceptionpublic void updateScheduledDeliveryTime(MessageReference ref) throws Exception
updateScheduledDeliveryTime in interface StorageManagerExceptionpublic void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
storeDuplicateID in interface StorageManagerExceptionpublic void deleteDuplicateID(long recordID)
throws Exception
deleteDuplicateID in interface StorageManagerExceptionpublic void storeMessageTransactional(long txID,
ServerMessage message)
throws Exception
storeMessageTransactional in interface StorageManagerExceptionpublic void storePageTransaction(long txID,
PageTransactionInfo pageTransaction)
throws Exception
storePageTransaction in interface StorageManagerExceptionpublic void updatePageTransaction(long txID,
PageTransactionInfo pageTransaction,
int depages)
throws Exception
updatePageTransaction in interface StorageManagerExceptionpublic void updatePageTransaction(PageTransactionInfo pageTransaction, int depages) throws Exception
updatePageTransaction in interface StorageManagerExceptionpublic void storeReferenceTransactional(long txID,
long queueID,
long messageID)
throws Exception
storeReferenceTransactional in interface StorageManagerExceptionpublic void storeAcknowledgeTransactional(long txID,
long queueID,
long messageID)
throws Exception
storeAcknowledgeTransactional in interface StorageManagerExceptionpublic void storeCursorAcknowledgeTransactional(long txID,
long queueID,
PagePosition position)
throws Exception
storeCursorAcknowledgeTransactional in interface StorageManagerExceptionpublic void deleteCursorAcknowledgeTransactional(long txID,
long ackID)
throws Exception
deleteCursorAcknowledgeTransactional in interface StorageManagerExceptionpublic long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
storeHeuristicCompletion in interface StorageManagerExceptionpublic void deleteHeuristicCompletion(long id)
throws Exception
deleteHeuristicCompletion in interface StorageManagerExceptionpublic void deletePageTransactional(long recordID)
throws Exception
deletePageTransactional in interface StorageManagerExceptionpublic void updateScheduledDeliveryTimeTransactional(long txID,
MessageReference ref)
throws Exception
updateScheduledDeliveryTimeTransactional in interface StorageManagerExceptionpublic void prepare(long txID,
Xid xid)
throws Exception
prepare in interface StorageManagerExceptionpublic void commit(long txID)
throws Exception
commit in interface StorageManagerExceptionpublic void commitBindings(long txID)
throws Exception
commitBindings in interface StorageManagerExceptionpublic void rollbackBindings(long txID)
throws Exception
rollbackBindings in interface StorageManagerExceptionpublic void commit(long txID,
boolean lineUpContext)
throws Exception
commit in interface StorageManagerExceptionpublic void rollback(long txID)
throws Exception
rollback 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 void deleteDuplicateIDTransactional(long txID,
long recordID)
throws Exception
deleteDuplicateIDTransactional in interface StorageManagerExceptionpublic void updateDeliveryCount(MessageReference ref) throws Exception
updateDeliveryCount in interface StorageManagerExceptionpublic void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
storeAddressSetting in interface StorageManagerExceptionpublic List<PersistedAddressSetting> recoverAddressSettings() throws Exception
recoverAddressSettings 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 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) throws Exception
loadMessageJournal in interface StorageManagerExceptionpublic void addGrouping(GroupBinding groupBinding) throws Exception
addGrouping in interface StorageManagerExceptionpublic void deleteGrouping(GroupBinding groupBinding) throws Exception
deleteGrouping in interface StorageManagerExceptionpublic void addQueueBinding(long tx,
Binding binding)
throws Exception
addQueueBinding in interface StorageManagerExceptionpublic void deleteQueueBinding(long queueBindingID)
throws Exception
deleteQueueBinding in interface StorageManagerExceptionpublic long storePageCounterInc(long txID,
long queueID,
int value)
throws Exception
storePageCounterInc in interface StorageManagerExceptionpublic long storePageCounterInc(long queueID,
int value)
throws Exception
storePageCounterInc in interface StorageManagerExceptionpublic long storePageCounter(long txID,
long queueID,
long value)
throws Exception
storePageCounter 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 static void describeBindingJournal(String bindingsDir) throws Exception
Exceptionpublic static void describeMessagesJournal(String messagesDir) throws Exception
Exceptionpublic JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
loadBindingJournal in interface StorageManagerExceptionpublic void lineUpContext()
lineUpContext in interface StorageManagerpublic void start()
throws Exception
start in interface HornetQComponentExceptionpublic void stop()
throws Exception
stop in interface HornetQComponentExceptionpublic void stop(boolean ioCriticalError)
throws Exception
stop in interface StorageManagerioCriticalError - is the server being stopped due to an IO critical errorExceptionpublic boolean isStarted()
isStarted in interface HornetQComponentpublic JournalLoadInformation[] loadInternalOnly() throws Exception
StorageManagerloadInternalOnly 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 Journal getMessageJournal()
public Journal getBindingsJournal()
protected OperationContext getContext(boolean sync)
public static Object newObjectEncoding(RecordInfo info)
public static Object newObjectEncoding(RecordInfo info, JournalStorageManager storageManager)
protected static PersistedRoles newSecurityRecord(long id, HornetQBuffer buffer)
id - buffer - protected static PersistedAddressSetting newAddressEncoding(long id, HornetQBuffer buffer)
id - buffer - protected static JournalStorageManager.GroupingEncoding newGroupEncoding(long id, HornetQBuffer buffer)
id - buffer - protected static JournalStorageManager.PersistentQueueBindingEncoding newBindingEncoding(long id, HornetQBuffer buffer)
id - buffer - protected static void describeJournal(SequentialFileFactory fileFactory, JournalImpl journal) throws Exception
fileFactory - journal - ExceptionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.