|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.util.ServiceSupport
org.apache.activemq.broker.LockableServiceSupport
org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter
public class KahaDBPersistenceAdapter
An implementation of PersistenceAdapter designed for use with
KahaDB - Embedded Lightweight Non-Relational Database
| Constructor Summary | |
|---|---|
KahaDBPersistenceAdapter()
|
|
| Method Summary | |
|---|---|
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 |
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 |
KahaTransactionInfo |
createTransactionInfo(TransactionId txid)
|
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()
|
void |
doStop(ServiceStopper stopper)
|
long |
getCheckpointInterval()
Get the checkpointInterval |
long |
getCleanupInterval()
Get the cleanupInterval |
Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the ActiveMQDestination
objects that the persistence store is aware exist. |
File |
getDirectory()
Get the directory |
File |
getDirectoryArchive()
|
int |
getFailoverProducersAuditDepth()
|
boolean |
getForceRecoverIndex()
|
int |
getIndexCacheSize()
Get the indexCacheSize |
float |
getIndexLFUEvictionFactor()
|
int |
getIndexWriteBatchSize()
Get the indexWriteBatchSize |
int |
getJournalMaxFileLength()
Get the journalMaxFileLength |
int |
getJournalMaxWriteBatchSize()
Get the journalMaxWriteBatchSize |
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 |
int |
getMaxAsyncJobs()
|
int |
getMaxFailoverProducersToTrack()
|
KahaDBStore |
getStore()
|
void |
init()
Initialize resources before locking |
boolean |
isArchiveCorruptedIndex()
|
boolean |
isArchiveDataLogs()
|
boolean |
isCheckForCorruptJournalFiles()
|
boolean |
isChecksumJournalFiles()
|
boolean |
isConcurrentStoreAndDispatchQueues()
|
boolean |
isConcurrentStoreAndDispatchTopics()
|
boolean |
isEnableIndexDiskSyncs()
|
boolean |
isEnableIndexPageCaching()
|
boolean |
isEnableIndexRecoveryFile()
|
boolean |
isEnableIndexWriteAsync()
Get the enableIndexWriteAsync |
boolean |
isEnableJournalDiskSyncs()
Get the enableJournalDiskSyncs |
boolean |
isIgnoreMissingJournalfiles()
Get the ignoreMissingJournalfiles |
boolean |
isRewriteOnRedelivery()
|
boolean |
isUseIndexLFRUEviction()
|
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 |
setArchiveCorruptedIndex(boolean archiveCorruptedIndex)
|
void |
setArchiveDataLogs(boolean archiveDataLogs)
|
void |
setBrokerName(String brokerName)
Set the name of the broker using the adapter |
void |
setBrokerService(BrokerService brokerService)
|
void |
setCheckForCorruptJournalFiles(boolean checkForCorruptJournalFiles)
|
void |
setCheckpointInterval(long checkpointInterval)
Set the checkpointInterval |
void |
setChecksumJournalFiles(boolean checksumJournalFiles)
|
void |
setCleanupInterval(long cleanupInterval)
Set the cleanupInterval |
void |
setConcurrentStoreAndDispatchQueues(boolean concurrentStoreAndDispatch)
|
void |
setConcurrentStoreAndDispatchTopics(boolean concurrentStoreAndDispatch)
|
void |
setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
Deprecated. use Locker.setLockAcquireSleepInterval(long) instead |
void |
setDirectory(File dir)
Set the directory where any data files should be created |
void |
setDirectoryArchive(File directoryArchive)
|
void |
setEnableIndexDiskSyncs(boolean diskSyncs)
|
void |
setEnableIndexPageCaching(boolean enable)
|
void |
setEnableIndexRecoveryFile(boolean enable)
|
void |
setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
Set the enableIndexWriteAsync |
void |
setEnableJournalDiskSyncs(boolean enableJournalDiskSyncs)
Set the enableJournalDiskSyncs |
void |
setFailoverProducersAuditDepth(int failoverProducersAuditDepth)
set the audit window depth for duplicate suppression (should exceed the max transaction batch) |
void |
setForceRecoverIndex(boolean forceRecoverIndex)
|
void |
setIgnoreMissingJournalfiles(boolean ignoreMissingJournalfiles)
Set the ignoreMissingJournalfiles |
void |
setIndexCacheSize(int indexCacheSize)
Set the indexCacheSize When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setIndexLFUEvictionFactor(float indexLFUEvictionFactor)
|
void |
setIndexWriteBatchSize(int indexWriteBatchSize)
Set the indexWriteBatchSize When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setJournalMaxFileLength(int journalMaxFileLength)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
Set the journalMaxWriteBatchSize * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setMaxAsyncJobs(int maxAsyncJobs)
|
void |
setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack)
Set the max number of producers (LRU cache) to track for duplicate sends |
void |
setRewriteOnRedelivery(boolean rewriteOnRedelivery)
When true, persist the redelivery status such that the message redelivery flag can survive a broker failure used with org.apache.activemq.ActiveMQConnectionFactory#setTransactedIndividualAck(boolean) true |
void |
setUsageManager(SystemUsage usageManager)
|
void |
setUseIndexLFRUEviction(boolean useIndexLFRUEviction)
|
long |
size()
A hint to return the size of the store on disk |
String |
toString()
|
| Methods inherited from class org.apache.activemq.broker.LockableServiceSupport |
|---|
getLocker, getScheduledThreadPoolExecutor, keepLockAlive, postStop, preStart, setLocker, setLockKeepAlivePeriod, setUseLock, stopBroker |
| Methods inherited from class org.apache.activemq.util.ServiceSupport |
|---|
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.activemq.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public KahaDBPersistenceAdapter()
| Method Detail |
|---|
public void beginTransaction(ConnectionContext context)
throws IOException
PersistenceAdapter
beginTransaction in interface PersistenceAdaptercontext -
IOExceptionPersistenceAdapter.beginTransaction(org.apache.activemq.broker.ConnectionContext)
public void checkpoint(boolean sync)
throws IOException
PersistenceAdapter
checkpoint in interface PersistenceAdaptersync -
IOExceptionPersistenceAdapter.checkpoint(boolean)
public void commitTransaction(ConnectionContext context)
throws IOException
PersistenceAdapter
commitTransaction in interface PersistenceAdaptercontext -
IOExceptionPersistenceAdapter.commitTransaction(org.apache.activemq.broker.ConnectionContext)
public MessageStore createQueueMessageStore(ActiveMQQueue destination)
throws IOException
PersistenceAdapter
createQueueMessageStore in interface PersistenceAdapterdestination -
IOExceptionPersistenceAdapter.createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue)
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
throws IOException
PersistenceAdapter
createTopicMessageStore in interface PersistenceAdapterdestination -
IOExceptionPersistenceAdapter.createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic)
public TransactionStore createTransactionStore()
throws IOException
PersistenceAdapter
createTransactionStore in interface PersistenceAdapterIOExceptionPersistenceAdapter.createTransactionStore()
public void deleteAllMessages()
throws IOException
PersistenceAdapter
deleteAllMessages in interface PersistenceAdapterIOExceptionPersistenceAdapter.deleteAllMessages()public Set<ActiveMQDestination> getDestinations()
PersistenceAdapterActiveMQDestination
objects that the persistence store is aware exist.
getDestinations in interface PersistenceAdapterPersistenceAdapter.getDestinations()
public long getLastMessageBrokerSequenceId()
throws IOException
getLastMessageBrokerSequenceId in interface PersistenceAdapterIOExceptionPersistenceAdapter.getLastMessageBrokerSequenceId()
public long getLastProducerSequenceId(ProducerId id)
throws IOException
PersistenceAdapter
getLastProducerSequenceId in interface PersistenceAdapterid - the producerId to find a sequenceId for
IOExceptionpublic void removeQueueMessageStore(ActiveMQQueue destination)
PersistenceAdapter
removeQueueMessageStore in interface PersistenceAdapterdestination - PersistenceAdapter.removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue)public void removeTopicMessageStore(ActiveMQTopic destination)
PersistenceAdapter
removeTopicMessageStore in interface PersistenceAdapterdestination - PersistenceAdapter.removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic)
public void rollbackTransaction(ConnectionContext context)
throws IOException
PersistenceAdapter
rollbackTransaction in interface PersistenceAdaptercontext -
IOExceptionPersistenceAdapter.rollbackTransaction(org.apache.activemq.broker.ConnectionContext)public void setBrokerName(String brokerName)
PersistenceAdapter
setBrokerName in interface PersistenceAdapterbrokerName - PersistenceAdapter.setBrokerName(java.lang.String)public void setUsageManager(SystemUsage usageManager)
setUsageManager in interface PersistenceAdapterusageManager - PersistenceAdapter.setUsageManager(org.apache.activemq.usage.SystemUsage)public long size()
PersistenceAdapter
size in interface PersistenceAdapterPersistenceAdapter.size()
public void doStart()
throws Exception
doStart in class ServiceSupportExceptionService.start()
public void doStop(ServiceStopper stopper)
throws Exception
doStop in class ServiceSupportExceptionService.stop()public int getJournalMaxFileLength()
public void setJournalMaxFileLength(int journalMaxFileLength)
public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack)
public int getMaxFailoverProducersToTrack()
public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth)
public int getFailoverProducersAuditDepth()
public long getCheckpointInterval()
public void setCheckpointInterval(long checkpointInterval)
checkpointInterval - the checkpointInterval to setpublic long getCleanupInterval()
public void setCleanupInterval(long cleanupInterval)
cleanupInterval - the cleanupInterval to setpublic int getIndexWriteBatchSize()
public void setIndexWriteBatchSize(int indexWriteBatchSize)
indexWriteBatchSize - the indexWriteBatchSize to setpublic int getJournalMaxWriteBatchSize()
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
journalMaxWriteBatchSize - the journalMaxWriteBatchSize to setpublic boolean isEnableIndexWriteAsync()
public void setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
enableIndexWriteAsync - the enableIndexWriteAsync to setpublic File getDirectory()
getDirectory in interface PersistenceAdapterpublic void setDirectory(File dir)
PersistenceAdapter
setDirectory in interface PersistenceAdapterdir - PersistenceAdapter.setDirectory(java.io.File)public boolean isEnableJournalDiskSyncs()
public void setEnableJournalDiskSyncs(boolean enableJournalDiskSyncs)
enableJournalDiskSyncs - the enableJournalDiskSyncs to setpublic int getIndexCacheSize()
public void setIndexCacheSize(int indexCacheSize)
indexCacheSize - the indexCacheSize to setpublic boolean isIgnoreMissingJournalfiles()
public void setIgnoreMissingJournalfiles(boolean ignoreMissingJournalfiles)
ignoreMissingJournalfiles - the ignoreMissingJournalfiles to setpublic boolean isChecksumJournalFiles()
public boolean isCheckForCorruptJournalFiles()
public void setChecksumJournalFiles(boolean checksumJournalFiles)
public void setCheckForCorruptJournalFiles(boolean checkForCorruptJournalFiles)
public void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwaresetBrokerService in class LockableServiceSupportpublic boolean isArchiveDataLogs()
public void setArchiveDataLogs(boolean archiveDataLogs)
public File getDirectoryArchive()
public void setDirectoryArchive(File directoryArchive)
public boolean isConcurrentStoreAndDispatchQueues()
public void setConcurrentStoreAndDispatchQueues(boolean concurrentStoreAndDispatch)
public boolean isConcurrentStoreAndDispatchTopics()
public void setConcurrentStoreAndDispatchTopics(boolean concurrentStoreAndDispatch)
public int getMaxAsyncJobs()
public void setMaxAsyncJobs(int maxAsyncJobs)
maxAsyncJobs - the maxAsyncJobs to set
@Deprecated
public void setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
throws IOException
Locker.setLockAcquireSleepInterval(long) instead
databaseLockedWaitDelay - the databaseLockedWaitDelay to set
IOExceptionpublic boolean getForceRecoverIndex()
public void setForceRecoverIndex(boolean forceRecoverIndex)
public boolean isArchiveCorruptedIndex()
public void setArchiveCorruptedIndex(boolean archiveCorruptedIndex)
public void setRewriteOnRedelivery(boolean rewriteOnRedelivery)
public boolean isRewriteOnRedelivery()
public float getIndexLFUEvictionFactor()
public void setIndexLFUEvictionFactor(float indexLFUEvictionFactor)
public boolean isUseIndexLFRUEviction()
public void setUseIndexLFRUEviction(boolean useIndexLFRUEviction)
public void setEnableIndexDiskSyncs(boolean diskSyncs)
public boolean isEnableIndexDiskSyncs()
public void setEnableIndexRecoveryFile(boolean enable)
public boolean isEnableIndexRecoveryFile()
public void setEnableIndexPageCaching(boolean enable)
public boolean isEnableIndexPageCaching()
public KahaDBStore getStore()
public KahaTransactionInfo createTransactionInfo(TransactionId txid)
public Locker createDefaultLocker()
throws IOException
Lockable
createDefaultLocker in interface LockableIOException
public void init()
throws Exception
LockableServiceSupport
init in class LockableServiceSupportExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||