public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implements PersistenceAdapter, BrokerServiceAware, NoLocalSubscriptionAware
PersistenceAdapter
that supports
distribution of destinations across multiple kahaDB persistence adaptersbrokerService, clockDaemon
Constructor and Description |
---|
MultiKahaDBPersistenceAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
allowIOResumption() |
void |
beginTransaction(ConnectionContext context)
This method starts a transaction on the persistent storage - which is
nothing to do with JMS or XA transactions - its purely a mechanism to
perform multiple writes to a persistent store in 1 transaction as a
performance optimization.
|
void |
checkpoint(boolean sync)
checkpoint any
|
void |
commitTransaction(ConnectionContext context)
Commit a persistence transaction
|
Locker |
createDefaultLocker()
Create a default locker
|
JobSchedulerStore |
createJobSchedulerStore()
Creates and returns a new Job Scheduler store instance.
|
MessageStore |
createQueueMessageStore(ActiveMQQueue destination)
Factory method to create a new queue message store with the given
destination name
|
TopicMessageStore |
createTopicMessageStore(ActiveMQTopic destination)
Factory method to create a new topic message store with the given
destination name
|
TransactionStore |
createTransactionStore()
Factory method to create a new persistent prepared transaction store for
XA recovery
|
void |
deleteAllMessages()
Delete's all the messages in the persistent store.
|
void |
doStart() |
protected void |
doStop(ServiceStopper stopper) |
List<PersistenceAdapter> |
getAdapters() |
Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the
ActiveMQDestination objects that the
persistence store is aware exist. |
File |
getDirectory() |
int |
getJournalMaxFileLength() |
int |
getJournalWriteBatchSize() |
long |
getLastMessageBrokerSequenceId() |
long |
getLastProducerSequenceId(ProducerId id)
return the last stored producer sequenceId for this producer Id used to
suppress duplicate sends on failover reconnect at the transport when a
reconnect occurs
|
void |
init()
Initialize resources before locking
|
boolean |
isLocalXid(TransactionId xid) |
boolean |
isPersistNoLocal() |
static String |
nameFromDestinationFilter(ActiveMQDestination destination) |
void |
removeQueueMessageStore(ActiveMQQueue destination)
Cleanup method to remove any state associated with the given destination.
|
void |
removeTopicMessageStore(ActiveMQTopic destination)
Cleanup method to remove any state associated with the given destination
This method does not stop the message store (it might not be cached).
|
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction
|
void |
setBrokerName(String brokerName)
Set the name of the broker using the adapter
|
void |
setBrokerService(BrokerService brokerService) |
void |
setDirectory(File directory)
Set the directory where any data files should be created
|
void |
setFilteredPersistenceAdapters(List entries)
Sets the FilteredKahaDBPersistenceAdapter entries
|
void |
setJournalMaxFileLength(int maxFileLength)
Set the max file length of the transaction journal
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can
be used
|
void |
setJournalWriteBatchSize(int journalWriteBatchSize)
Set the max write batch size of the transaction journal
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can
be used
|
void |
setTransactionStore(MultiKahaDBTransactionStore transactionStore) |
void |
setUsageManager(SystemUsage usageManager) |
long |
size()
A hint to return the size of the store on disk
|
String |
toString() |
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isUseLock, keepLockAlive, postStop, preStart, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setUseLock, stopBroker
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
public MultiKahaDBPersistenceAdapter()
public void setFilteredPersistenceAdapters(List entries)
public static String nameFromDestinationFilter(ActiveMQDestination destination)
public boolean isLocalXid(TransactionId xid)
public void beginTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
IOException
public void checkpoint(boolean sync) throws IOException
PersistenceAdapter
checkpoint
in interface PersistenceAdapter
IOException
public void commitTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException
PersistenceAdapter
createQueueMessageStore
in interface PersistenceAdapter
IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException
PersistenceAdapter
createTopicMessageStore
in interface PersistenceAdapter
IOException
public TransactionStore createTransactionStore() throws IOException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
IOException
public void deleteAllMessages() throws IOException
PersistenceAdapter
deleteAllMessages
in interface PersistenceAdapter
IOException
public Set<ActiveMQDestination> getDestinations()
PersistenceAdapter
ActiveMQDestination
objects that the
persistence store is aware exist.getDestinations
in interface PersistenceAdapter
public long getLastMessageBrokerSequenceId() throws IOException
getLastMessageBrokerSequenceId
in interface PersistenceAdapter
IOException
public long getLastProducerSequenceId(ProducerId id) throws IOException
PersistenceAdapter
getLastProducerSequenceId
in interface PersistenceAdapter
id
- the producerId to find a sequenceId forIOException
public void allowIOResumption()
allowIOResumption
in interface PersistenceAdapter
public void removeQueueMessageStore(ActiveMQQueue destination)
PersistenceAdapter
removeQueueMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic void removeTopicMessageStore(ActiveMQTopic destination)
PersistenceAdapter
removeTopicMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic void rollbackTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void setBrokerName(String brokerName)
PersistenceAdapter
setBrokerName
in interface PersistenceAdapter
public void setUsageManager(SystemUsage usageManager)
setUsageManager
in interface PersistenceAdapter
usageManager
- The UsageManager that is controlling the broker's memory
usage.public long size()
PersistenceAdapter
size
in interface PersistenceAdapter
public void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
public File getDirectory()
getDirectory
in interface PersistenceAdapter
public void setDirectory(File directory)
PersistenceAdapter
setDirectory
in interface PersistenceAdapter
public void init() throws Exception
LockableServiceSupport
init
in class LockableServiceSupport
Exception
public void setBrokerService(BrokerService brokerService)
setBrokerService
in interface BrokerServiceAware
setBrokerService
in class LockableServiceSupport
public void setTransactionStore(MultiKahaDBTransactionStore transactionStore)
public void setJournalMaxFileLength(int maxFileLength)
public int getJournalMaxFileLength()
public void setJournalWriteBatchSize(int journalWriteBatchSize)
public int getJournalWriteBatchSize()
public List<PersistenceAdapter> getAdapters()
public Locker createDefaultLocker() throws IOException
Lockable
createDefaultLocker
in interface Lockable
IOException
public JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
PersistenceAdapter
createJobSchedulerStore
in interface PersistenceAdapter
IOException
- If an error occurs while creating the new JobSchedulerStore.UnsupportedOperationException
- If this adapter does not provide its own
scheduler store implementation.public boolean isPersistNoLocal()
isPersistNoLocal
in interface NoLocalSubscriptionAware
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.