Package org.apache.activemq.store.kahadb
Class TempKahaDBStore
- java.lang.Object
-
- org.apache.activemq.store.kahadb.TempMessageDatabase
-
- org.apache.activemq.store.kahadb.TempKahaDBStore
-
- All Implemented Interfaces:
BrokerServiceAware,Service,PersistenceAdapter
public class TempKahaDBStore extends TempMessageDatabase implements PersistenceAdapter, BrokerServiceAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTempKahaDBStore.KahaDBMessageStore-
Nested classes/interfaces inherited from class org.apache.activemq.store.kahadb.TempMessageDatabase
TempMessageDatabase.MessageKeysMarshaller, TempMessageDatabase.StoredDestinationMarshaller
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.store.kahadb.TempMessageDatabase
CLOSED_STATE, destinations, directory, indexMutex, inflightTransactions, OPEN_STATE, opened, pageFile, preparedTransactions, started
-
-
Constructor Summary
Constructors Constructor Description TempKahaDBStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallowIOResumption()voidbeginTransaction(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.voidcheckpoint(boolean sync)checkpoint anyvoidcommitTransaction(ConnectionContext context)Commit a persistence transactionJobSchedulerStorecreateJobSchedulerStore()Creates and returns a new Job Scheduler store instance.MessageStorecreateQueueMessageStore(ActiveMQQueue destination)Factory method to create a new queue message store with the given destination nameTopicMessageStorecreateTopicMessageStore(ActiveMQTopic destination)Factory method to create a new topic message store with the given destination nameTransactionStorecreateTransactionStore()Factory method to create a new persistent prepared transaction store for XA recoveryvoiddeleteAllMessages()Delete's all the messages in the persistent store.Set<ActiveMQDestination>getDestinations()Returns a set of all theActiveMQDestinationobjects that the persistence store is aware exist.longgetLastMessageBrokerSequenceId()longgetLastProducerSequenceId(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 occursvoidload()voidremoveQueueMessageStore(ActiveMQQueue destination)Cleanup method to remove any state associated with the given destination.voidremoveTopicMessageStore(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).voidrollbackTransaction(ConnectionContext context)Rollback a persistence transactionvoidsetBrokerName(String brokerName)Set the name of the broker using the adaptervoidsetBrokerService(BrokerService brokerService)voidsetUsageManager(SystemUsage usageManager)longsize()A hint to return the size of the store on disk-
Methods inherited from class org.apache.activemq.store.kahadb.TempMessageDatabase
close, getDirectory, getIndexWriteBatchSize, getJournalFilesBeingReplicated, getPageFile, getStoredDestination, open, process, process, processAdd, processCommit, processPrepare, processRemove, processRollback, setDirectory, setEnableIndexWriteAsync, setIndexWriteBatchSize, start, stop, unload
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.store.PersistenceAdapter
getDirectory, setDirectory
-
-
-
-
Method Detail
-
setBrokerName
public void setBrokerName(String brokerName)
Description copied from interface:PersistenceAdapterSet the name of the broker using the adapter- Specified by:
setBrokerNamein interfacePersistenceAdapter
-
setUsageManager
public void setUsageManager(SystemUsage usageManager)
- Specified by:
setUsageManagerin interfacePersistenceAdapter- Parameters:
usageManager- The UsageManager that is controlling the broker's memory usage.
-
createTransactionStore
public TransactionStore createTransactionStore() throws IOException
Description copied from interface:PersistenceAdapterFactory method to create a new persistent prepared transaction store for XA recovery- Specified by:
createTransactionStorein interfacePersistenceAdapter- Returns:
- transaction store
- Throws:
IOException
-
createQueueMessageStore
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException
Description copied from interface:PersistenceAdapterFactory method to create a new queue message store with the given destination name- Specified by:
createQueueMessageStorein interfacePersistenceAdapter- Returns:
- the message store
- Throws:
IOException
-
createTopicMessageStore
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException
Description copied from interface:PersistenceAdapterFactory method to create a new topic message store with the given destination name- Specified by:
createTopicMessageStorein interfacePersistenceAdapter- Returns:
- the topic message store
- Throws:
IOException
-
removeQueueMessageStore
public void removeQueueMessageStore(ActiveMQQueue 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).- Specified by:
removeQueueMessageStorein interfacePersistenceAdapter- Parameters:
destination- Destination to forget
-
removeTopicMessageStore
public 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).- Specified by:
removeTopicMessageStorein interfacePersistenceAdapter- Parameters:
destination- Destination to forget
-
deleteAllMessages
public void deleteAllMessages() throws IOExceptionDescription copied from interface:PersistenceAdapterDelete's all the messages in the persistent store.- Specified by:
deleteAllMessagesin interfacePersistenceAdapter- Throws:
IOException
-
getDestinations
public Set<ActiveMQDestination> getDestinations()
Description copied from interface:PersistenceAdapterReturns a set of all theActiveMQDestinationobjects that the persistence store is aware exist.- Specified by:
getDestinationsin interfacePersistenceAdapter- Returns:
- active destinations
-
getLastMessageBrokerSequenceId
public long getLastMessageBrokerSequenceId() throws IOException- Specified by:
getLastMessageBrokerSequenceIdin interfacePersistenceAdapter- Returns:
- last broker sequence
- Throws:
IOException
-
size
public long size()
Description copied from interface:PersistenceAdapterA hint to return the size of the store on disk- Specified by:
sizein interfacePersistenceAdapter- Returns:
- disk space used in bytes of 0 if not implemented
-
beginTransaction
public void beginTransaction(ConnectionContext context) throws IOException
Description copied from interface:PersistenceAdapterThis 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. Typically one transaction will require one disk synchronization point and so for real high performance its usually faster to perform many writes within the same transaction to minimize latency caused by disk synchronization. This is especially true when using tools like Berkeley Db or embedded JDBC servers.- Specified by:
beginTransactionin interfacePersistenceAdapter- Throws:
IOException
-
commitTransaction
public void commitTransaction(ConnectionContext context) throws IOException
Description copied from interface:PersistenceAdapterCommit a persistence transaction- Specified by:
commitTransactionin interfacePersistenceAdapter- Throws:
IOException- See Also:
PersistenceAdapter.beginTransaction(ConnectionContext context)
-
rollbackTransaction
public void rollbackTransaction(ConnectionContext context) throws IOException
Description copied from interface:PersistenceAdapterRollback a persistence transaction- Specified by:
rollbackTransactionin interfacePersistenceAdapter- Throws:
IOException- See Also:
PersistenceAdapter.beginTransaction(ConnectionContext context)
-
checkpoint
public void checkpoint(boolean sync) throws IOExceptionDescription copied from interface:PersistenceAdaptercheckpoint any- Specified by:
checkpointin interfacePersistenceAdapter- Throws:
IOException
-
getLastProducerSequenceId
public long getLastProducerSequenceId(ProducerId id)
Description copied from interface:PersistenceAdapterreturn the last stored producer sequenceId for this producer Id used to suppress duplicate sends on failover reconnect at the transport when a reconnect occurs- Specified by:
getLastProducerSequenceIdin interfacePersistenceAdapter- Parameters:
id- the producerId to find a sequenceId for- Returns:
- the last stored sequence id or -1 if no suppression needed
-
allowIOResumption
public void allowIOResumption()
- Specified by:
allowIOResumptionin interfacePersistenceAdapter
-
setBrokerService
public void setBrokerService(BrokerService brokerService)
- Specified by:
setBrokerServicein interfaceBrokerServiceAware
-
load
public void load() throws IOException- Overrides:
loadin classTempMessageDatabase- Throws:
IOException
-
createJobSchedulerStore
public JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException
Description copied from interface:PersistenceAdapterCreates and returns a new Job Scheduler store instance.- Specified by:
createJobSchedulerStorein interfacePersistenceAdapter- Returns:
- a new JobSchedulerStore instance if this Persistence adapter provides its own.
- Throws:
IOException- If an error occurs while creating the new JobSchedulerStore.UnsupportedOperationException- If this adapter does not provide its own scheduler store implementation.
-
-