Package org.apache.activemq.store.kahadb
Class MultiKahaDBPersistenceAdapter
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.broker.LockableServiceSupport
-
- org.apache.activemq.store.kahadb.MultiKahaDBPersistenceAdapter
-
- All Implemented Interfaces:
BrokerServiceAware,Lockable,org.apache.activemq.Service,NoLocalSubscriptionAware,PersistenceAdapter
public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implements PersistenceAdapter, BrokerServiceAware, NoLocalSubscriptionAware
An implementation ofPersistenceAdapterthat supports distribution of destinations across multiple kahaDB persistence adapters
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.LockableServiceSupport
brokerService, clockDaemon
-
-
Constructor Summary
Constructors Constructor Description MultiKahaDBPersistenceAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallowIOResumption()voidbeginTransaction(ConnectionContext context)voidcheckpoint(boolean cleanup)voidcommitTransaction(ConnectionContext context)LockercreateDefaultLocker()JobSchedulerStorecreateJobSchedulerStore()MessageStorecreateQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)TopicMessageStorecreateTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)TransactionStorecreateTransactionStore()voiddeleteAllMessages()voiddoStart()protected voiddoStop(ServiceStopper stopper)List<PersistenceAdapter>getAdapters()Set<org.apache.activemq.command.ActiveMQDestination>getDestinations()FilegetDirectory()longgetJournalCleanupInterval()intgetJournalMaxFileLength()intgetJournalWriteBatchSize()longgetLastMessageBrokerSequenceId()longgetLastProducerSequenceId(org.apache.activemq.command.ProducerId id)voidinit()booleanisCheckForCorruption()booleanisLocalXid(org.apache.activemq.command.TransactionId xid)booleanisPersistNoLocal()static StringnameFromDestinationFilter(org.apache.activemq.command.ActiveMQDestination destination)voidremoveQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)voidremoveTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)voidrollbackTransaction(ConnectionContext context)voidsetBrokerName(String brokerName)voidsetBrokerService(BrokerService brokerService)voidsetCheckForCorruption(boolean checkForCorruption)voidsetDirectory(File directory)voidsetFilteredPersistenceAdapters(List entries)Sets the FilteredKahaDBPersistenceAdapter entriesvoidsetJournalCleanupInterval(long journalCleanupInterval)voidsetJournalMaxFileLength(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 usedvoidsetJournalWriteBatchSize(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 usedvoidsetTransactionStore(MultiKahaDBTransactionStore transactionStore)voidsetUsageManager(SystemUsage usageManager)longsize()StringtoString()-
Methods inherited from class org.apache.activemq.broker.LockableServiceSupport
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isStopOnError, isUseLock, keepLockAlive, postStop, preStart, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setStopOnError, setUseLock, stopBroker
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
-
-
-
-
Method Detail
-
setFilteredPersistenceAdapters
public void setFilteredPersistenceAdapters(List entries)
Sets the FilteredKahaDBPersistenceAdapter entries
-
nameFromDestinationFilter
public static String nameFromDestinationFilter(org.apache.activemq.command.ActiveMQDestination destination)
-
isLocalXid
public boolean isLocalXid(org.apache.activemq.command.TransactionId xid)
-
beginTransaction
public void beginTransaction(ConnectionContext context) throws IOException
- Specified by:
beginTransactionin interfacePersistenceAdapter- Throws:
IOException
-
checkpoint
public void checkpoint(boolean cleanup) throws IOException- Specified by:
checkpointin interfacePersistenceAdapter- Throws:
IOException
-
commitTransaction
public void commitTransaction(ConnectionContext context) throws IOException
- Specified by:
commitTransactionin interfacePersistenceAdapter- Throws:
IOException
-
createQueueMessageStore
public MessageStore createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination) throws IOException
- Specified by:
createQueueMessageStorein interfacePersistenceAdapter- Throws:
IOException
-
createTopicMessageStore
public TopicMessageStore createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination) throws IOException
- Specified by:
createTopicMessageStorein interfacePersistenceAdapter- Throws:
IOException
-
createTransactionStore
public TransactionStore createTransactionStore() throws IOException
- Specified by:
createTransactionStorein interfacePersistenceAdapter- Throws:
IOException
-
deleteAllMessages
public void deleteAllMessages() throws IOException- Specified by:
deleteAllMessagesin interfacePersistenceAdapter- Throws:
IOException
-
getDestinations
public Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
- Specified by:
getDestinationsin interfacePersistenceAdapter
-
getLastMessageBrokerSequenceId
public long getLastMessageBrokerSequenceId() throws IOException- Specified by:
getLastMessageBrokerSequenceIdin interfacePersistenceAdapter- Throws:
IOException
-
getLastProducerSequenceId
public long getLastProducerSequenceId(org.apache.activemq.command.ProducerId id) throws IOException- Specified by:
getLastProducerSequenceIdin interfacePersistenceAdapter- Throws:
IOException
-
allowIOResumption
public void allowIOResumption()
- Specified by:
allowIOResumptionin interfacePersistenceAdapter
-
removeQueueMessageStore
public void removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
- Specified by:
removeQueueMessageStorein interfacePersistenceAdapter
-
removeTopicMessageStore
public void removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
- Specified by:
removeTopicMessageStorein interfacePersistenceAdapter
-
rollbackTransaction
public void rollbackTransaction(ConnectionContext context) throws IOException
- Specified by:
rollbackTransactionin interfacePersistenceAdapter- Throws:
IOException
-
setBrokerName
public void setBrokerName(String brokerName)
- Specified by:
setBrokerNamein interfacePersistenceAdapter
-
setUsageManager
public void setUsageManager(SystemUsage usageManager)
- Specified by:
setUsageManagerin interfacePersistenceAdapter
-
size
public long size()
- Specified by:
sizein interfacePersistenceAdapter
-
doStart
public void doStart() throws Exception- Specified by:
doStartin classServiceSupport- Throws:
Exception
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Specified by:
doStopin classServiceSupport- Throws:
Exception
-
getDirectory
public File getDirectory()
- Specified by:
getDirectoryin interfacePersistenceAdapter
-
setDirectory
public void setDirectory(File directory)
- Specified by:
setDirectoryin interfacePersistenceAdapter
-
init
public void init() throws Exception- Specified by:
initin classLockableServiceSupport- Throws:
Exception
-
setBrokerService
public void setBrokerService(BrokerService brokerService)
- Specified by:
setBrokerServicein interfaceBrokerServiceAware- Overrides:
setBrokerServicein classLockableServiceSupport
-
setTransactionStore
public void setTransactionStore(MultiKahaDBTransactionStore transactionStore)
-
setJournalMaxFileLength
public 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
-
getJournalMaxFileLength
public int getJournalMaxFileLength()
-
setJournalWriteBatchSize
public 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
-
getJournalWriteBatchSize
public int getJournalWriteBatchSize()
-
setJournalCleanupInterval
public void setJournalCleanupInterval(long journalCleanupInterval)
-
getJournalCleanupInterval
public long getJournalCleanupInterval()
-
setCheckForCorruption
public void setCheckForCorruption(boolean checkForCorruption)
-
isCheckForCorruption
public boolean isCheckForCorruption()
-
getAdapters
public List<PersistenceAdapter> getAdapters()
-
createDefaultLocker
public Locker createDefaultLocker() throws IOException
- Specified by:
createDefaultLockerin interfaceLockable- Throws:
IOException
-
createJobSchedulerStore
public JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
- Specified by:
createJobSchedulerStorein interfacePersistenceAdapter- Throws:
IOExceptionUnsupportedOperationException
-
isPersistNoLocal
public boolean isPersistNoLocal()
- Specified by:
isPersistNoLocalin interfaceNoLocalSubscriptionAware
-
-