public class KahaDBStore extends MessageDatabase implements PersistenceAdapter, NoLocalSubscriptionAware
Modifier and Type | Class and Description |
---|---|
class |
KahaDBStore.KahaDBMessageStore |
static interface |
KahaDBStore.StoreTask |
class |
KahaDBStore.StoreTaskExecutor |
MessageDatabase.LastAckMarshaller, MessageDatabase.MessageKeysMarshaller, MessageDatabase.Metadata, MessageDatabase.PurgeRecoveredXATransactionStrategy, MessageDatabase.StoredDestinationMarshaller
Modifier and Type | Field and Description |
---|---|
protected List<Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask>> |
asyncQueueMaps |
protected List<Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask>> |
asyncTopicMaps |
static int |
cancelledTaskModMetric |
static String |
PROPERTY_ASYNC_EXECUTOR_MAX_THREADS |
static String |
PROPERTY_CANCELED_TASK_MOD_METRIC |
protected ExecutorService |
queueExecutor |
protected ExecutorService |
topicExecutor |
ackedAndPrepared, archiveDataLogs, brokerService, DEFAULT_DIRECTORY, deleteAllMessages, directory, directoryArchive, failIfDatabaseIsLocked, forceRecoverIndex, indexDirectory, indexLock, journal, journalDiskSyncStrategy, journalSize, lastAsyncJournalUpdate, LOG_SLOW_ACCESS_TIME, metadata, metadataMarshaller, opened, pageFile, persistenceAdapterStatistics, preparedTransactions, PROPERTY_LOG_SLOW_ACCESS_TIME, purgeRecoveredXATransactionStrategy, rolledBackAcks, scheduler, storeCache, storedDestinations, UNMATCHED
Constructor and Description |
---|
KahaDBStore() |
Modifier and Type | Method and Description |
---|---|
protected void |
addQueueTask(KahaDBStore.KahaDBMessageStore store,
org.apache.activemq.store.kahadb.KahaDBStore.StoreQueueTask task) |
protected void |
addTopicTask(org.apache.activemq.store.kahadb.KahaDBStore.KahaDBTopicMessageStore store,
org.apache.activemq.store.kahadb.KahaDBStore.StoreTopicTask task) |
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
|
protected void |
configureMetadata() |
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() |
void |
doStop(ServiceStopper stopper) |
Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the
ActiveMQDestination objects that the
persistence store is aware exist. |
boolean |
getForceRecoverIndex() |
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() |
TransactionIdTransformer |
getTransactionIdTransformer() |
SystemUsage |
getUsageManager() |
boolean |
isConcurrentStoreAndDispatchQueues() |
boolean |
isConcurrentStoreAndDispatchTopics() |
boolean |
isConcurrentStoreAndDispatchTransactions() |
boolean |
isPersistNoLocal() |
void |
removeQueueMessageStore(ActiveMQQueue destination)
Cleanup method to remove any state associated with the given destination.
|
protected org.apache.activemq.store.kahadb.KahaDBStore.StoreQueueTask |
removeQueueTask(KahaDBStore.KahaDBMessageStore store,
MessageId id) |
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).
|
protected org.apache.activemq.store.kahadb.KahaDBStore.StoreTopicTask |
removeTopicTask(org.apache.activemq.store.kahadb.KahaDBStore.KahaDBTopicMessageStore store,
MessageId id) |
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction
|
void |
setBrokerName(String brokerName)
Set the name of the broker using the adapter
|
void |
setConcurrentStoreAndDispatchQueues(boolean concurrentStoreAndDispatch) |
void |
setConcurrentStoreAndDispatchTopics(boolean concurrentStoreAndDispatch) |
void |
setForceRecoverIndex(boolean forceRecoverIndex) |
void |
setMaxAsyncJobs(int maxAsyncJobs) |
void |
setTransactionIdTransformer(TransactionIdTransformer transactionIdTransformer) |
void |
setUsageManager(SystemUsage usageManager) |
long |
size()
A hint to return the size of the store on disk
|
String |
toString() |
allowIOResumption, checkpointCleanup, clearStoreStats, close, createJournal, decrementAndSubSizeToStoreStat, decrementAndSubSizeToStoreStat, decrementAndSubSizeToStoreStat, decrementAndSubSizeToStoreStat, forgetRecoveredAcks, getCheckpointInterval, getCleanupInterval, getCompactAcksAfterNoGC, getDirectory, getDirectoryArchive, getExistingStoredDestination, getFailoverProducersAuditDepth, getIndexCacheSize, getIndexDirectory, getIndexLFUEvictionFactor, getIndexWriteBatchSize, getInProgressTxLocationRange, getJournal, getJournalDiskSyncInterval, getJournalDiskSyncStrategy, getJournalDiskSyncStrategyEnum, getJournalFilesBeingReplicated, getJournalMaxFileLength, getJournalMaxWriteBatchSize, getLastAck, getLastUpdatePosition, getMaxFailoverProducersToTrack, getMetadata, getPageFile, getPersistenceAdapterStatistics, getPreallocationScope, getPreallocationStrategy, getPurgeRecoveredXATransactionStrategy, getPurgeRecoveredXATransactionStrategyEnum, getSequenceSet, getStoredDestination, getStoredMessageCount, getStoredMessageSize, getStoredMessageSize, getStoreStats, getSubStats, getTransactions, incrementalRecover, incrementAndAddSizeToStoreStat, incrementAndAddSizeToStoreStat, incrementAndAddSizeToStoreStat, incrementAndAddSizeToStoreStat, isArchiveCorruptedIndex, isArchiveDataLogs, isCheckForCorruptJournalFiles, isChecksumJournalFiles, isCompactAcksIgnoresStoreGrowth, isDeleteAllMessages, isEnableAckCompaction, isEnableIndexDiskSyncs, isEnableIndexPageCaching, isEnableIndexRecoveryFile, isEnableJournalDiskSyncs, isEnableSubscriptionStatistics, isFailIfDatabaseIsLocked, isIgnoreMissingJournalfiles, isUseIndexLFRUEviction, key, load, load, matchType, open, process, process, process, process, process, process, process, process, process, processLocation, recoverIndex, setArchiveCorruptedIndex, setArchiveDataLogs, setBrokerService, setCheckForCorruptJournalFiles, setCheckpointInterval, setChecksumJournalFiles, setCleanupInterval, setCompactAcksAfterNoGC, setCompactAcksIgnoresStoreGrowth, setDeleteAllMessages, setDirectory, setDirectoryArchive, setEnableAckCompaction, setEnableIndexDiskSyncs, setEnableIndexPageCaching, setEnableIndexRecoveryFile, setEnableIndexWriteAsync, setEnableJournalDiskSyncs, setEnableSubscriptionStatistics, setFailIfDatabaseIsLocked, setFailoverProducersAuditDepth, setIgnoreMissingJournalfiles, setIndexCacheSize, setIndexDirectory, setIndexLFUEvictionFactor, setIndexWriteBatchSize, setJournalDiskSyncInterval, setJournalDiskSyncStrategy, setJournalMaxFileLength, setJournalMaxWriteBatchSize, setMaxFailoverProducersToTrack, setPreallocationScope, setPreallocationStrategy, setPurgeRecoveredXATransactionStrategy, setUseIndexLFRUEviction, store, store, store, store, toByteSequence, trackRecoveredAcks, unload
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
allowIOResumption, getDirectory, setDirectory
public static final String PROPERTY_CANCELED_TASK_MOD_METRIC
public static final int cancelledTaskModMetric
public static final String PROPERTY_ASYNC_EXECUTOR_MAX_THREADS
protected ExecutorService queueExecutor
protected ExecutorService topicExecutor
protected final List<Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask>> asyncQueueMaps
protected final List<Map<org.apache.activemq.store.kahadb.KahaDBStore.AsyncJobKey,KahaDBStore.StoreTask>> asyncTopicMaps
public KahaDBStore()
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 SystemUsage getUsageManager()
public boolean isConcurrentStoreAndDispatchQueues()
public void setConcurrentStoreAndDispatchQueues(boolean concurrentStoreAndDispatch)
concurrentStoreAndDispatch
- the concurrentStoreAndDispatch to setpublic boolean isConcurrentStoreAndDispatchTopics()
public void setConcurrentStoreAndDispatchTopics(boolean concurrentStoreAndDispatch)
concurrentStoreAndDispatch
- the concurrentStoreAndDispatch to setpublic boolean isConcurrentStoreAndDispatchTransactions()
public int getMaxAsyncJobs()
public void setMaxAsyncJobs(int maxAsyncJobs)
maxAsyncJobs
- the maxAsyncJobs to setprotected void configureMetadata()
configureMetadata
in class MessageDatabase
public void doStart() throws Exception
doStart
in class MessageDatabase
Exception
public void doStop(ServiceStopper stopper) throws Exception
doStop
in class MessageDatabase
Exception
protected org.apache.activemq.store.kahadb.KahaDBStore.StoreQueueTask removeQueueTask(KahaDBStore.KahaDBMessageStore store, MessageId id)
protected void addQueueTask(KahaDBStore.KahaDBMessageStore store, org.apache.activemq.store.kahadb.KahaDBStore.StoreQueueTask task) throws IOException
IOException
protected org.apache.activemq.store.kahadb.KahaDBStore.StoreTopicTask removeTopicTask(org.apache.activemq.store.kahadb.KahaDBStore.KahaDBTopicMessageStore store, MessageId id)
protected void addTopicTask(org.apache.activemq.store.kahadb.KahaDBStore.KahaDBTopicMessageStore store, org.apache.activemq.store.kahadb.KahaDBStore.StoreTopicTask task) throws IOException
IOException
public TransactionStore createTransactionStore() throws IOException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
IOException
public boolean getForceRecoverIndex()
public void setForceRecoverIndex(boolean forceRecoverIndex)
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 void removeQueueMessageStore(ActiveMQQueue destination)
removeQueueMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic void removeTopicMessageStore(ActiveMQTopic destination)
removeTopicMessageStore
in interface PersistenceAdapter
destination
- Destination to forgetpublic 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)
PersistenceAdapter
getLastProducerSequenceId
in interface PersistenceAdapter
id
- the producerId to find a sequenceId forpublic long size()
PersistenceAdapter
size
in interface PersistenceAdapter
public void beginTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
IOException
public void commitTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void rollbackTransaction(ConnectionContext context) throws IOException
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void checkpoint(boolean sync) throws IOException
PersistenceAdapter
checkpoint
in interface PersistenceAdapter
IOException
public TransactionIdTransformer getTransactionIdTransformer()
public void setTransactionIdTransformer(TransactionIdTransformer transactionIdTransformer)
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.