public class KahaDBStore.KahaDBMessageStore extends AbstractMessageStore
Modifier and Type | Field and Description |
---|---|
protected Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask> |
asyncTaskMap |
protected KahaDestination |
dest |
destination, FUTURE, indexListener, messageStoreStatistics, prioritizedMessages
Constructor and Description |
---|
KahaDBMessageStore(ActiveMQDestination destination) |
Modifier and Type | Method and Description |
---|---|
protected void |
acquireLocalAsyncLock() |
void |
addMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
ListenableFuture<Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for.
|
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the
messageNumber.
|
boolean |
isEmpty()
flag to indicate if the store is empty
|
protected void |
lockAsyncJobQueue() |
void |
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.
|
protected void |
recoverMessageStoreStatistics() |
void |
recoverNextMessages(int maxReturned,
MessageRecoveryListener listener) |
protected int |
recoverRolledBackAcks(org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd,
Transaction tx,
int maxReturned,
MessageRecoveryListener listener) |
protected void |
releaseLocalAsyncLock() |
void |
removeAllMessages(ConnectionContext context)
Removes all the messages from the message store.
|
void |
removeAsyncMessage(ConnectionContext context,
MessageAck ack) |
void |
removeMessage(ConnectionContext context,
MessageAck ack)
Removes a message from the message store.
|
void |
resetBatching()
A hint to the Store to reset any batching state for the Destination
|
void |
setBatch(MessageId identity)
allow caching cursors to set the current batch offset when cache is exhausted
|
void |
setMemoryUsage(MemoryUsage memoryUsage) |
void |
start() |
void |
stop() |
String |
toString() |
protected void |
unlockAsyncJobQueue() |
void |
updateMessage(Message message) |
addMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getIndexListener, getMessageCount, getMessageSize, getMessageStoreStatistics, isPrioritizedMessages, registerIndexListener, setPrioritizedMessages
protected final Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask> asyncTaskMap
protected KahaDestination dest
public KahaDBMessageStore(ActiveMQDestination destination)
public ActiveMQDestination getDestination()
MessageStore
getDestination
in interface MessageStore
getDestination
in class AbstractMessageStore
public ListenableFuture<Object> asyncAddQueueMessage(ConnectionContext context, Message message) throws IOException
MessageStore
asyncAddQueueMessage
in interface MessageStore
asyncAddQueueMessage
in class AbstractMessageStore
context
- contextIOException
public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException
removeAsyncMessage
in interface MessageStore
removeAsyncMessage
in class AbstractMessageStore
IOException
public void addMessage(ConnectionContext context, Message message) throws IOException
MessageStore
context
- contextIOException
public void updateMessage(Message message) throws IOException
updateMessage
in interface MessageStore
updateMessage
in class AbstractMessageStore
IOException
public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException
MessageStore
ack
- the ack request that cause the message to be removed. It
conatins the identity which contains the messageID of the
message that needs to be removed.IOException
public void removeAllMessages(ConnectionContext context) throws IOException
MessageStore
IOException
public Message getMessage(MessageId identity) throws IOException
MessageStore
identity
- which contains either the messageID or the messageNumberIOException
public boolean isEmpty() throws IOException
AbstractMessageStore
isEmpty
in interface MessageStore
isEmpty
in class AbstractMessageStore
IOException
public void recover(MessageRecoveryListener listener) throws Exception
MessageStore
Exception
public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
Exception
protected int recoverRolledBackAcks(org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, Transaction tx, int maxReturned, MessageRecoveryListener listener) throws Exception
Exception
public void resetBatching()
MessageStore
public void setBatch(MessageId identity) throws IOException
MessageStore
setBatch
in interface MessageStore
setBatch
in class AbstractMessageStore
IOException
public void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage
in interface MessageStore
setMemoryUsage
in class AbstractMessageStore
memoryUsage
- The SystemUsage that is controlling the
destination's memory usage.public void start() throws Exception
start
in interface Service
start
in class AbstractMessageStore
Exception
public void stop() throws Exception
stop
in interface Service
stop
in class AbstractMessageStore
Exception
protected void lockAsyncJobQueue()
protected void unlockAsyncJobQueue()
protected void acquireLocalAsyncLock()
protected void releaseLocalAsyncLock()
protected void recoverMessageStoreStatistics() throws IOException
recoverMessageStoreStatistics
in class AbstractMessageStore
IOException
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.