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 StorageManager
public boolean isReplicated()
isReplicated
in interface StorageManager
public void waitOnOperations() throws Exception
StorageManager
waitOnOperations
in interface StorageManager
Exception
public boolean waitOnOperations(long timeout) throws Exception
StorageManager
waitOnOperations
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 OperationContext getContext()
StorageManager
getContext
in interface StorageManager
public void setContext(OperationContext context)
StorageManager
setContext
in interface StorageManager
public Executor getSingleThreadExecutor()
public OperationContext newSingleThreadContext()
newSingleThreadContext
in interface StorageManager
public OperationContext newContext(Executor executor)
StorageManager
newContext
in interface StorageManager
public void afterCompleteOperations(IOAsyncTask run)
afterCompleteOperations
in interface StorageManager
public long generateUniqueID()
generateUniqueID
in interface StorageManager
public long getCurrentUniqueID()
getCurrentUniqueID
in interface StorageManager
public LargeServerMessage createLargeMessage()
createLargeMessage
in interface StorageManager
public void addBytesToLargeMessage(SequentialFile file, long messageId, byte[] bytes) throws Exception
Exception
public LargeServerMessage createLargeMessage(long id, MessageInternal message) throws Exception
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.Exception
public long storePendingLargeMessage(long messageID) throws Exception
Exception
public void confirmPendingLargeMessageTX(Transaction tx, long messageID, long recordID) throws Exception
confirmPendingLargeMessageTX
in interface StorageManager
Exception
public void confirmPendingLargeMessage(long recordID) throws Exception
confirmPendingLargeMessage
in interface StorageManager
Exception
public void storeMessage(ServerMessage message) throws Exception
storeMessage
in interface StorageManager
Exception
public void storeReference(long queueID, long messageID, boolean last) throws Exception
storeReference
in interface StorageManager
Exception
public void storeAcknowledge(long queueID, long messageID) throws Exception
storeAcknowledge
in interface StorageManager
Exception
public void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception
storeCursorAcknowledge
in interface StorageManager
Exception
public void deleteMessage(long messageID) throws Exception
deleteMessage
in interface StorageManager
Exception
public void updateScheduledDeliveryTime(MessageReference ref) throws Exception
updateScheduledDeliveryTime
in interface StorageManager
Exception
public void storeDuplicateID(SimpleString address, byte[] duplID, long recordID) throws Exception
storeDuplicateID
in interface StorageManager
Exception
public void deleteDuplicateID(long recordID) throws Exception
deleteDuplicateID
in interface StorageManager
Exception
public void storeMessageTransactional(long txID, ServerMessage message) throws Exception
storeMessageTransactional
in interface StorageManager
Exception
public void storePageTransaction(long txID, PageTransactionInfo pageTransaction) throws Exception
storePageTransaction
in interface StorageManager
Exception
public void updatePageTransaction(long txID, PageTransactionInfo pageTransaction, int depages) throws Exception
updatePageTransaction
in interface StorageManager
Exception
public void updatePageTransaction(PageTransactionInfo pageTransaction, int depages) throws Exception
updatePageTransaction
in interface StorageManager
Exception
public void storeReferenceTransactional(long txID, long queueID, long messageID) throws Exception
storeReferenceTransactional
in interface StorageManager
Exception
public void storeAcknowledgeTransactional(long txID, long queueID, long messageID) throws Exception
storeAcknowledgeTransactional
in interface StorageManager
Exception
public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception
storeCursorAcknowledgeTransactional
in interface StorageManager
Exception
public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception
deleteCursorAcknowledgeTransactional
in interface StorageManager
Exception
public long storeHeuristicCompletion(Xid xid, boolean isCommit) throws Exception
storeHeuristicCompletion
in interface StorageManager
Exception
public void deleteHeuristicCompletion(long id) throws Exception
deleteHeuristicCompletion
in interface StorageManager
Exception
public void deletePageTransactional(long recordID) throws Exception
deletePageTransactional
in interface StorageManager
Exception
public void updateScheduledDeliveryTimeTransactional(long txID, MessageReference ref) throws Exception
updateScheduledDeliveryTimeTransactional
in interface StorageManager
Exception
public void prepare(long txID, Xid xid) throws Exception
prepare
in interface StorageManager
Exception
public void commit(long txID) throws Exception
commit
in interface StorageManager
Exception
public void commitBindings(long txID) throws Exception
commitBindings
in interface StorageManager
Exception
public void rollbackBindings(long txID) throws Exception
rollbackBindings
in interface StorageManager
Exception
public void commit(long txID, boolean lineUpContext) throws Exception
commit
in interface StorageManager
Exception
public void rollback(long txID) throws Exception
rollback
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 void deleteDuplicateIDTransactional(long txID, long recordID) throws Exception
deleteDuplicateIDTransactional
in interface StorageManager
Exception
public void updateDeliveryCount(MessageReference ref) throws Exception
updateDeliveryCount
in interface StorageManager
Exception
public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
storeAddressSetting
in interface StorageManager
Exception
public List<PersistedAddressSetting> recoverAddressSettings() throws Exception
recoverAddressSettings
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 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 StorageManager
Exception
public void addGrouping(GroupBinding groupBinding) throws Exception
addGrouping
in interface StorageManager
Exception
public void deleteGrouping(GroupBinding groupBinding) throws Exception
deleteGrouping
in interface StorageManager
Exception
public void addQueueBinding(long tx, Binding binding) throws Exception
addQueueBinding
in interface StorageManager
Exception
public void deleteQueueBinding(long queueBindingID) throws Exception
deleteQueueBinding
in interface StorageManager
Exception
public long storePageCounterInc(long txID, long queueID, int value) throws Exception
storePageCounterInc
in interface StorageManager
Exception
public long storePageCounterInc(long queueID, int value) throws Exception
storePageCounterInc
in interface StorageManager
Exception
public long storePageCounter(long txID, long queueID, long value) throws Exception
storePageCounter
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 static void describeBindingJournal(String bindingsDir) throws Exception
Exception
public static void describeMessagesJournal(String messagesDir) throws Exception
Exception
public JournalLoadInformation loadBindingJournal(List<QueueBindingInfo> queueBindingInfos, List<GroupingInfo> groupingInfos) throws Exception
loadBindingJournal
in interface StorageManager
Exception
public void lineUpContext()
lineUpContext
in interface StorageManager
public void start() throws Exception
start
in interface HornetQComponent
Exception
public void stop() throws Exception
stop
in interface HornetQComponent
Exception
public void stop(boolean ioCriticalError) throws Exception
stop
in interface StorageManager
ioCriticalError
- is the server being stopped due to an IO critical errorException
public boolean isStarted()
isStarted
in interface HornetQComponent
public JournalLoadInformation[] loadInternalOnly() throws Exception
StorageManager
loadInternalOnly
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 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
- Exception
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.