public class KahaDBPersistenceAdapter extends LockableServiceSupport implements PersistenceAdapter, JournaledStore, TransactionIdTransformerAware
PersistenceAdapter
designed for use with
KahaDB - Embedded Lightweight Non-Relational DatabasebrokerService, clockDaemon
Constructor and Description |
---|
KahaDBPersistenceAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
allowIOResumption() |
void |
beginTransaction(ConnectionContext context) |
void |
checkpoint(boolean cleanup) |
void |
commitTransaction(ConnectionContext context) |
Locker |
createDefaultLocker() |
JobSchedulerStore |
createJobSchedulerStore() |
MessageStore |
createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination) |
TopicMessageStore |
createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination) |
KahaTransactionInfo |
createTransactionInfo(org.apache.activemq.command.TransactionId txid) |
TransactionStore |
createTransactionStore() |
void |
deleteAllMessages() |
void |
doStart() |
void |
doStop(ServiceStopper stopper) |
long |
getCheckpointInterval()
Get the checkpointInterval
|
long |
getCleanupInterval()
Get the cleanupInterval
|
boolean |
getCleanupOnStop() |
int |
getCompactAcksAfterNoGC() |
Set<org.apache.activemq.command.ActiveMQDestination> |
getDestinations() |
File |
getDirectory()
Get the directory
|
File |
getDirectoryArchive() |
int |
getFailoverProducersAuditDepth() |
boolean |
getForceRecoverIndex() |
int |
getIndexCacheSize()
Get the indexCacheSize
|
File |
getIndexDirectory() |
float |
getIndexLFUEvictionFactor() |
int |
getIndexWriteBatchSize()
Get the indexWriteBatchSize
|
long |
getJournalDiskSyncInterval() |
String |
getJournalDiskSyncStrategy() |
Journal.JournalDiskSyncStrategy |
getJournalDiskSyncStrategyEnum() |
int |
getJournalMaxFileLength()
Get the journalMaxFileLength
|
int |
getJournalMaxWriteBatchSize()
Get the journalMaxWriteBatchSize
|
long |
getLastMessageBrokerSequenceId() |
long |
getLastProducerSequenceId(org.apache.activemq.command.ProducerId id) |
int |
getMaxAsyncJobs() |
int |
getMaxFailoverProducersToTrack() |
String |
getPreallocationScope() |
String |
getPreallocationStrategy() |
KahaDBStore |
getStore() |
void |
init() |
boolean |
isArchiveCorruptedIndex() |
boolean |
isArchiveDataLogs() |
boolean |
isCheckForCorruptJournalFiles() |
boolean |
isChecksumJournalFiles() |
boolean |
isCompactAcksIgnoresStoreGrowth() |
boolean |
isConcurrentStoreAndDispatchQueues() |
boolean |
isConcurrentStoreAndDispatchTopics() |
boolean |
isEnableAckCompaction()
Returns whether Ack compaction is enabled
|
boolean |
isEnableIndexDiskSyncs() |
boolean |
isEnableIndexPageCaching() |
boolean |
isEnableIndexRecoveryFile() |
boolean |
isEnableIndexWriteAsync()
Get the enableIndexWriteAsync
|
boolean |
isEnableJournalDiskSyncs()
Deprecated.
use
getJournalDiskSyncStrategy() instead |
boolean |
isIgnoreMissingJournalfiles()
Get the ignoreMissingJournalfiles
|
boolean |
isUseIndexLFRUEviction() |
void |
removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination) |
void |
removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination) |
void |
rollbackTransaction(ConnectionContext context) |
void |
setArchiveCorruptedIndex(boolean archiveCorruptedIndex) |
void |
setArchiveDataLogs(boolean archiveDataLogs) |
void |
setBrokerName(String brokerName) |
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 |
setCleanupOnStop(boolean cleanupOnStop) |
void |
setCompactAcksAfterNoGC(int compactAcksAfterNoGC)
Sets the number of GC cycles where no journal logs were removed before an attempt to
move forward all the acks in the last log that contains them and is otherwise unreferenced.
|
void |
setCompactAcksIgnoresStoreGrowth(boolean compactAcksIgnoresStoreGrowth)
Configure if Ack compaction will occur regardless of continued growth of the
journal logs meaning that the store has not run out of space yet.
|
void |
setConcurrentStoreAndDispatchQueues(boolean concurrentStoreAndDispatch) |
void |
setConcurrentStoreAndDispatchTopics(boolean concurrentStoreAndDispatch) |
void |
setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
Deprecated.
use
Locker.setLockAcquireSleepInterval(long) instead |
void |
setDirectory(File dir) |
void |
setDirectoryArchive(File directoryArchive) |
void |
setEnableAckCompaction(boolean enableAckCompaction)
Configure if the Ack compaction task should be enabled to run
|
void |
setEnableIndexDiskSyncs(boolean diskSyncs) |
void |
setEnableIndexPageCaching(boolean enable) |
void |
setEnableIndexRecoveryFile(boolean enable) |
void |
setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
Set the enableIndexWriteAsync
|
void |
setEnableJournalDiskSyncs(boolean enableJournalDiskSyncs)
Deprecated.
use
setJournalDiskSyncStrategy(java.lang.String) instead |
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 |
setIndexDirectory(File indexDirectory)
Sets the directory where KahaDB index files should be written.
|
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 |
setJournalDiskSyncInterval(long journalDiskSyncInterval) |
void |
setJournalDiskSyncStrategy(String journalDiskSyncStrategy) |
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 |
setPreallocationScope(String preallocationScope) |
void |
setPreallocationStrategy(String preallocationStrategy) |
void |
setTransactionIdTransformer(TransactionIdTransformer transactionIdTransformer) |
void |
setUsageManager(SystemUsage usageManager) |
void |
setUseIndexLFRUEviction(boolean useIndexLFRUEviction) |
long |
size() |
String |
toString() |
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isUseLock, keepLockAlive, postStop, preStart, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setUseLock, stopBroker
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
public KahaDBPersistenceAdapter()
public void beginTransaction(ConnectionContext context) throws IOException
beginTransaction
in interface PersistenceAdapter
context
- IOException
PersistenceAdapter.beginTransaction(org.apache.activemq.broker.ConnectionContext)
public void checkpoint(boolean cleanup) throws IOException
checkpoint
in interface PersistenceAdapter
cleanup
- IOException
PersistenceAdapter.checkpoint(boolean)
public void commitTransaction(ConnectionContext context) throws IOException
commitTransaction
in interface PersistenceAdapter
context
- IOException
PersistenceAdapter.commitTransaction(org.apache.activemq.broker.ConnectionContext)
public MessageStore createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination) throws IOException
createQueueMessageStore
in interface PersistenceAdapter
destination
- IOException
PersistenceAdapter.createQueueMessageStore(org.apache.activemq.command.ActiveMQQueue)
public TopicMessageStore createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination) throws IOException
createTopicMessageStore
in interface PersistenceAdapter
destination
- IOException
PersistenceAdapter.createTopicMessageStore(org.apache.activemq.command.ActiveMQTopic)
public TransactionStore createTransactionStore() throws IOException
createTransactionStore
in interface PersistenceAdapter
IOException
PersistenceAdapter.createTransactionStore()
public void deleteAllMessages() throws IOException
deleteAllMessages
in interface PersistenceAdapter
IOException
PersistenceAdapter.deleteAllMessages()
public Set<org.apache.activemq.command.ActiveMQDestination> getDestinations()
getDestinations
in interface PersistenceAdapter
PersistenceAdapter.getDestinations()
public long getLastMessageBrokerSequenceId() throws IOException
getLastMessageBrokerSequenceId
in interface PersistenceAdapter
IOException
PersistenceAdapter.getLastMessageBrokerSequenceId()
public long getLastProducerSequenceId(org.apache.activemq.command.ProducerId id) throws IOException
getLastProducerSequenceId
in interface PersistenceAdapter
IOException
public void allowIOResumption()
allowIOResumption
in interface PersistenceAdapter
public void removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue destination)
removeQueueMessageStore
in interface PersistenceAdapter
destination
- PersistenceAdapter.removeQueueMessageStore(org.apache.activemq.command.ActiveMQQueue)
public void removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic destination)
removeTopicMessageStore
in interface PersistenceAdapter
destination
- PersistenceAdapter.removeTopicMessageStore(org.apache.activemq.command.ActiveMQTopic)
public void rollbackTransaction(ConnectionContext context) throws IOException
rollbackTransaction
in interface PersistenceAdapter
context
- IOException
PersistenceAdapter.rollbackTransaction(org.apache.activemq.broker.ConnectionContext)
public void setBrokerName(String brokerName)
setBrokerName
in interface PersistenceAdapter
brokerName
- PersistenceAdapter.setBrokerName(java.lang.String)
public void setUsageManager(SystemUsage usageManager)
setUsageManager
in interface PersistenceAdapter
usageManager
- PersistenceAdapter.setUsageManager(org.apache.activemq.usage.SystemUsage)
public long size()
size
in interface PersistenceAdapter
PersistenceAdapter.size()
public void doStart() throws Exception
doStart
in class ServiceSupport
Exception
Service.start()
public void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
Service.stop()
public int getJournalMaxFileLength()
getJournalMaxFileLength
in interface JournaledStore
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 PersistenceAdapter
public void setDirectory(File dir)
setDirectory
in interface PersistenceAdapter
dir
- PersistenceAdapter.setDirectory(java.io.File)
public File getIndexDirectory()
public void setIndexDirectory(File indexDirectory)
indexDirectory
- the directory where the KahaDB store index files should be written.public boolean isEnableJournalDiskSyncs()
getJournalDiskSyncStrategy()
insteadpublic void setEnableJournalDiskSyncs(boolean enableJournalDiskSyncs)
setJournalDiskSyncStrategy(java.lang.String)
insteadenableJournalDiskSyncs
- the enableJournalDiskSyncs to setpublic String getJournalDiskSyncStrategy()
public Journal.JournalDiskSyncStrategy getJournalDiskSyncStrategyEnum()
public void setJournalDiskSyncStrategy(String journalDiskSyncStrategy)
journalDiskSyncStrategy
- public long getJournalDiskSyncInterval()
public void setJournalDiskSyncInterval(long journalDiskSyncInterval)
journalDiskSyncInterval
- public 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 BrokerServiceAware
setBrokerService
in class LockableServiceSupport
public String getPreallocationScope()
public void setPreallocationScope(String preallocationScope)
public String getPreallocationStrategy()
public void setPreallocationStrategy(String preallocationStrategy)
public 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)
insteaddatabaseLockedWaitDelay
- the databaseLockedWaitDelay to setIOException
public boolean getForceRecoverIndex()
public void setForceRecoverIndex(boolean forceRecoverIndex)
public boolean isArchiveCorruptedIndex()
public void setArchiveCorruptedIndex(boolean archiveCorruptedIndex)
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 int getCompactAcksAfterNoGC()
public void setCompactAcksAfterNoGC(int compactAcksAfterNoGC)
A value of -1 will disable this feature.
compactAcksAfterNoGC
- Number of empty GC cycles before we rewrite old ACKS.public boolean isCompactAcksIgnoresStoreGrowth()
public void setCompactAcksIgnoresStoreGrowth(boolean compactAcksIgnoresStoreGrowth)
compactAcksIgnoresStoreGrowth
- the compactAcksIgnoresStoreGrowth to setpublic boolean isEnableAckCompaction()
public void setEnableAckCompaction(boolean enableAckCompaction)
enableAckCompaction
- public KahaDBStore getStore()
public KahaTransactionInfo createTransactionInfo(org.apache.activemq.command.TransactionId txid)
public Locker createDefaultLocker() throws IOException
createDefaultLocker
in interface Lockable
IOException
public void init() throws Exception
init
in class LockableServiceSupport
Exception
public void setTransactionIdTransformer(TransactionIdTransformer transactionIdTransformer)
setTransactionIdTransformer
in interface TransactionIdTransformerAware
public JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
createJobSchedulerStore
in interface PersistenceAdapter
IOException
UnsupportedOperationException
public void setCleanupOnStop(boolean cleanupOnStop)
public boolean getCleanupOnStop()
Copyright © 2005–2019 FuseSource, Corp.. All rights reserved.