org.apache.activemq.store.kahadaptor
Class KahaReferenceStoreAdapter

java.lang.Object
  extended by org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter
      extended by org.apache.activemq.store.kahadaptor.KahaReferenceStoreAdapter
All Implemented Interfaces:
BrokerServiceAware, Service, PersistenceAdapter, ReferenceStoreAdapter

public class KahaReferenceStoreAdapter
extends KahaPersistenceAdapter
implements ReferenceStoreAdapter


Field Summary
 
Fields inherited from class org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter
messageStores, queues, topics, transactionStore, wireFormat
 
Constructor Summary
KahaReferenceStoreAdapter(AtomicLong size)
           
 
Method Summary
protected  void addSubscriberState(SubscriptionInfo info)
           
 void clearMessages()
          called by recover to clear out message references
 void commitTransaction(ConnectionContext context)
          Commit a persistence transaction
 MessageStore createQueueMessageStore(ActiveMQQueue destination)
          Factory method to create a new queue message store with the given destination name
 ReferenceStore createQueueReferenceStore(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
 TopicReferenceStore createTopicReferenceStore(ActiveMQTopic destination)
          Factory method to create a new topic message store with the given destination name
 void deleteAllMessages()
          Delete's all the messages in the persistent store.
 int getIndexBinSize()
           
 int getIndexKeySize()
           
 int getIndexLoadFactor()
           
 int getIndexMaxBinSize()
           
 int getIndexPageSize()
           
protected  MapContainer<MessageId,ReferenceRecord> getMapReferenceContainer(Object id, String containerName)
           
 Set<Integer> getReferenceFileIdsInUse()
           
protected  Store getStateStore()
           
 boolean isPersistentIndex()
           
 boolean isStoreValid()
          If the store isn't valid, it can be recoverd at start-up
 void recordAckFileReferences(int ackDataFileId, int messageFileId)
           
 void recoverState()
          recover any state
 void recoverSubscription(SubscriptionInfo info)
          Recover particular subscription.
 void removeReferenceStore(KahaReferenceStore referenceStore)
           
protected  void removeSubscriberState(SubscriptionInfo info)
           
 Map<TransactionId,AMQTx> retrievePreparedState()
           
 void savePreparedState(Map<TransactionId,AMQTx> map)
          Save prepared transactions
 void setDirectory(File directory)
          Set the directory where any data files should be created
 void setIndexBinSize(int indexBinSize)
           
 void setIndexKeySize(int indexKeySize)
           
 void setIndexLoadFactor(int loadFactor)
           
 void setIndexMaxBinSize(int maxBinSize)
           
 void setIndexPageSize(int indexPageSize)
           
 void setPersistentIndex(boolean persistentIndex)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter
beginTransaction, checkpoint, createMessageMarshaller, createStore, createTransactionStore, getBrokerName, getDestinations, getDirectory, getLastMessageBrokerSequenceId, getLastProducerSequenceId, getListContainer, getMapContainer, getMaxDataFileLength, getStore, getSubsMapContainer, removeQueueMessageStore, removeTopicMessageStore, retrieveMessageStore, rollbackTransaction, setBrokerName, setBrokerService, setMaxDataFileLength, setUsageManager, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.store.ReferenceStoreAdapter
getMaxDataFileLength, setMaxDataFileLength
 
Methods inherited from interface org.apache.activemq.store.PersistenceAdapter
beginTransaction, checkpoint, createTransactionStore, getDestinations, getDirectory, getLastMessageBrokerSequenceId, getLastProducerSequenceId, removeQueueMessageStore, removeTopicMessageStore, rollbackTransaction, setBrokerName, setUsageManager, size
 

Constructor Detail

KahaReferenceStoreAdapter

public KahaReferenceStoreAdapter(AtomicLong size)
Method Detail

createQueueMessageStore

public MessageStore createQueueMessageStore(ActiveMQQueue destination)
                                     throws IOException
Description copied from interface: PersistenceAdapter
Factory method to create a new queue message store with the given destination name

Specified by:
createQueueMessageStore in interface PersistenceAdapter
Overrides:
createQueueMessageStore in class KahaPersistenceAdapter
Returns:
the message store
Throws:
IOException

createTopicMessageStore

public TopicMessageStore createTopicMessageStore(ActiveMQTopic destination)
                                          throws IOException
Description copied from interface: PersistenceAdapter
Factory method to create a new topic message store with the given destination name

Specified by:
createTopicMessageStore in interface PersistenceAdapter
Overrides:
createTopicMessageStore in class KahaPersistenceAdapter
Returns:
the topic message store
Throws:
IOException

start

public void start()
           throws Exception
Specified by:
start in interface Service
Overrides:
start in class KahaPersistenceAdapter
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Overrides:
stop in class KahaPersistenceAdapter
Throws:
Exception

commitTransaction

public void commitTransaction(ConnectionContext context)
                       throws IOException
Description copied from interface: PersistenceAdapter
Commit a persistence transaction

Specified by:
commitTransaction in interface PersistenceAdapter
Overrides:
commitTransaction in class KahaPersistenceAdapter
Throws:
IOException
See Also:
PersistenceAdapter.beginTransaction(ConnectionContext context)

isStoreValid

public boolean isStoreValid()
Description copied from interface: ReferenceStoreAdapter
If the store isn't valid, it can be recoverd at start-up

Specified by:
isStoreValid in interface ReferenceStoreAdapter
Returns:
true if the reference store is in a consistent state

createQueueReferenceStore

public ReferenceStore createQueueReferenceStore(ActiveMQQueue destination)
                                         throws IOException
Description copied from interface: ReferenceStoreAdapter
Factory method to create a new queue message store with the given destination name

Specified by:
createQueueReferenceStore in interface ReferenceStoreAdapter
Returns:
the QueueReferenceStore
Throws:
IOException

createTopicReferenceStore

public TopicReferenceStore createTopicReferenceStore(ActiveMQTopic destination)
                                              throws IOException
Description copied from interface: ReferenceStoreAdapter
Factory method to create a new topic message store with the given destination name

Specified by:
createTopicReferenceStore in interface ReferenceStoreAdapter
Returns:
the TopicRefererenceStore
Throws:
IOException

removeReferenceStore

public void removeReferenceStore(KahaReferenceStore referenceStore)

getMapReferenceContainer

protected MapContainer<MessageId,ReferenceRecord> getMapReferenceContainer(Object id,
                                                                           String containerName)
                                                                    throws IOException
Throws:
IOException

getReferenceFileIdsInUse

public Set<Integer> getReferenceFileIdsInUse()
                                      throws IOException
Specified by:
getReferenceFileIdsInUse in interface ReferenceStoreAdapter
Returns:
Throws:
IOException
See Also:
ReferenceStoreAdapter.getReferenceFileIdsInUse()

recordAckFileReferences

public void recordAckFileReferences(int ackDataFileId,
                                    int messageFileId)

clearMessages

public void clearMessages()
                   throws IOException
Description copied from interface: ReferenceStoreAdapter
called by recover to clear out message references

Specified by:
clearMessages in interface ReferenceStoreAdapter
Throws:
IOException
See Also:
ReferenceStoreAdapter.clearMessages()

recoverState

public void recoverState()
                  throws IOException
Description copied from interface: ReferenceStoreAdapter
recover any state

Specified by:
recoverState in interface ReferenceStoreAdapter
Throws:
IOException
See Also:
ReferenceStoreAdapter.recoverState()

recoverSubscription

public void recoverSubscription(SubscriptionInfo info)
                         throws IOException
Description copied from interface: ReferenceStoreAdapter
Recover particular subscription. Used for recovery of durable consumers

Specified by:
recoverSubscription in interface ReferenceStoreAdapter
Throws:
IOException

retrievePreparedState

public Map<TransactionId,AMQTx> retrievePreparedState()
                                               throws IOException
Specified by:
retrievePreparedState in interface ReferenceStoreAdapter
Returns:
saved prepared transactions
Throws:
IOException

savePreparedState

public void savePreparedState(Map<TransactionId,AMQTx> map)
                       throws IOException
Description copied from interface: ReferenceStoreAdapter
Save prepared transactions

Specified by:
savePreparedState in interface ReferenceStoreAdapter
Throws:
IOException

setDirectory

public void setDirectory(File directory)
Description copied from interface: PersistenceAdapter
Set the directory where any data files should be created

Specified by:
setDirectory in interface PersistenceAdapter
Overrides:
setDirectory in class KahaPersistenceAdapter

getStateStore

protected Store getStateStore()
                       throws IOException
Throws:
IOException

deleteAllMessages

public void deleteAllMessages()
                       throws IOException
Description copied from interface: PersistenceAdapter
Delete's all the messages in the persistent store.

Specified by:
deleteAllMessages in interface PersistenceAdapter
Overrides:
deleteAllMessages in class KahaPersistenceAdapter
Throws:
IOException

isPersistentIndex

public boolean isPersistentIndex()
Overrides:
isPersistentIndex in class KahaPersistenceAdapter

setPersistentIndex

public void setPersistentIndex(boolean persistentIndex)
Overrides:
setPersistentIndex in class KahaPersistenceAdapter

addSubscriberState

protected void addSubscriberState(SubscriptionInfo info)
                           throws IOException
Throws:
IOException

removeSubscriberState

protected void removeSubscriberState(SubscriptionInfo info)

getIndexBinSize

public int getIndexBinSize()

setIndexBinSize

public void setIndexBinSize(int indexBinSize)

getIndexKeySize

public int getIndexKeySize()

setIndexKeySize

public void setIndexKeySize(int indexKeySize)

getIndexPageSize

public int getIndexPageSize()

setIndexPageSize

public void setIndexPageSize(int indexPageSize)

getIndexMaxBinSize

public int getIndexMaxBinSize()

setIndexMaxBinSize

public void setIndexMaxBinSize(int maxBinSize)

getIndexLoadFactor

public int getIndexLoadFactor()
Returns:
the loadFactor

setIndexLoadFactor

public void setIndexLoadFactor(int loadFactor)
Parameters:
loadFactor - the loadFactor to set


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.