|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.store.amq.AMQPersistenceAdapter
public class AMQPersistenceAdapter
An implementation of PersistenceAdapter
designed for use with a
Journal
and then check pointing asynchronously on a timeout with some
other long term persistent storage.
Constructor Summary | |
---|---|
AMQPersistenceAdapter()
|
Method Summary | |
---|---|
protected void |
addInProgressDataFile(AMQMessageStore store,
int dataFileId)
|
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)
When we checkpoint we move all the journalled data to long term storage. |
void |
cleanup()
Cleans up the data files |
void |
commitTransaction(ConnectionContext context)
Commit a persistence transaction |
protected AsyncDataManager |
createAsyncDataManager()
|
MessageStore |
createQueueMessageStore(ActiveMQQueue destination)
Factory method to create a new queue message store with the given destination name |
protected java.io.IOException |
createRecoveryFailedException(java.lang.Exception e)
|
protected KahaReferenceStoreAdapter |
createReferenceStoreAdapter()
|
TopicMessageStore |
createTopicMessageStore(ActiveMQTopic destinationName)
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 |
protected java.io.IOException |
createWriteException(DataStructure packet,
java.lang.Exception e)
|
protected java.io.IOException |
createWriteException(java.lang.String command,
java.lang.Exception e)
|
void |
deleteAllMessages()
Delete's all the messages in the persistent store. |
boolean |
doCheckpoint()
This does the actual checkpoint. |
protected boolean |
doLock()
|
AsyncDataManager |
getAsyncDataManager()
|
java.lang.String |
getBrokerName()
|
BrokerService |
getBrokerService()
|
long |
getCheckpointInterval()
|
long |
getCleanupInterval()
|
java.util.Set<ActiveMQDestination> |
getDestinations()
Returns a set of all the ActiveMQDestination
objects that the persistence store is aware exist. |
java.io.File |
getDirectory()
|
java.io.File |
getDirectoryArchive()
|
int |
getIndexBinSize()
|
int |
getIndexKeySize()
|
int |
getIndexLoadFactor()
|
int |
getIndexMaxBinSize()
|
int |
getIndexPageSize()
|
int |
getJournalThreadPriority()
|
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 |
getMaxCheckpointMessageAddSize()
|
int |
getMaxFileLength()
|
int |
getMaxReferenceFileLength()
|
ReferenceStoreAdapter |
getReferenceStoreAdapter()
|
TaskRunnerFactory |
getTaskRunnerFactory()
|
AMQTransactionStore |
getTransactionStore()
|
SystemUsage |
getUsageManager()
|
WireFormat |
getWireFormat()
|
boolean |
isArchiveDataLogs()
|
boolean |
isDisableLocking()
|
boolean |
isForceRecoverReferenceStore()
|
boolean |
isPersistentIndex()
|
boolean |
isRecoverReferenceStore()
|
boolean |
isSyncOnTransaction()
|
boolean |
isSyncOnWrite()
|
boolean |
isUseDedicatedTaskRunner()
|
boolean |
isUseNio()
|
protected void |
lock()
|
void |
onUsageChanged(Usage usage,
int oldPercentUsage,
int newPercentUsage)
|
DataStructure |
readCommand(Location location)
|
protected void |
removeInProgressDataFile(AMQMessageStore store,
int dataFileId)
|
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 |
void |
rollbackTransaction(ConnectionContext context)
Rollback a persistence transaction |
void |
setArchiveDataLogs(boolean archiveDataLogs)
|
void |
setAsyncDataManager(AsyncDataManager asyncDataManager)
|
void |
setBrokerName(java.lang.String brokerName)
Set the name of the broker using the adapter |
void |
setBrokerService(BrokerService brokerService)
|
void |
setCheckpointInterval(long checkpointInterval)
|
void |
setCleanupInterval(long cleanupInterval)
|
void |
setDirectory(java.io.File directory)
Set the directory where any data files should be created |
void |
setDirectoryArchive(java.io.File directoryArchive)
|
void |
setDisableLocking(boolean disableLocking)
|
void |
setForceRecoverReferenceStore(boolean forceRecoverReferenceStore)
|
void |
setIndexBinSize(int indexBinSize)
|
void |
setIndexKeySize(int indexKeySize)
|
void |
setIndexLoadFactor(int factor)
|
void |
setIndexMaxBinSize(int maxBinSize)
|
void |
setIndexPageSize(int indexPageSize)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setJournalThreadPriority(int journalThreadPriority)
|
void |
setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setMaxFileLength(int maxFileLength)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setMaxReferenceFileLength(int maxReferenceFileLength)
When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used |
void |
setPersistentIndex(boolean persistentIndex)
|
void |
setRecoverReferenceStore(boolean recoverReferenceStore)
|
void |
setReferenceStoreAdapter(ReferenceStoreAdapter referenceStoreAdapter)
|
void |
setSyncOnTransaction(boolean syncOnTransaction)
|
void |
setSyncOnWrite(boolean syncOnWrite)
|
void |
setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
|
void |
setUsageManager(SystemUsage usageManager)
|
void |
setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner)
|
void |
setUseNio(boolean useNio)
|
void |
setWireFormat(WireFormat wireFormat)
|
long |
size()
A hint to return the size of the store on disk |
void |
start()
|
void |
stop()
|
java.lang.String |
toString()
|
Location |
writeCommand(DataStructure command,
boolean syncHint)
|
Location |
writeCommand(DataStructure command,
boolean syncHint,
boolean forceSync)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AMQPersistenceAdapter()
Method Detail |
---|
public java.lang.String getBrokerName()
public void setBrokerName(java.lang.String brokerName)
PersistenceAdapter
setBrokerName
in interface PersistenceAdapter
public BrokerService getBrokerService()
public void setBrokerService(BrokerService brokerService)
setBrokerService
in interface BrokerServiceAware
public void start() throws java.lang.Exception
start
in interface Service
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface Service
java.lang.Exception
public void checkpoint(boolean sync)
checkpoint
in interface PersistenceAdapter
sync
- public boolean doCheckpoint()
public void cleanup()
java.io.IOException
public java.util.Set<ActiveMQDestination> getDestinations()
PersistenceAdapter
ActiveMQDestination
objects that the persistence store is aware exist.
getDestinations
in interface PersistenceAdapter
public MessageStore createQueueMessageStore(ActiveMQQueue destination) throws java.io.IOException
PersistenceAdapter
createQueueMessageStore
in interface PersistenceAdapter
java.io.IOException
public TopicMessageStore createTopicMessageStore(ActiveMQTopic destinationName) throws java.io.IOException
PersistenceAdapter
createTopicMessageStore
in interface PersistenceAdapter
java.io.IOException
public void removeQueueMessageStore(ActiveMQQueue destination)
removeQueueMessageStore
in interface PersistenceAdapter
destination
- public void removeTopicMessageStore(ActiveMQTopic destination)
removeTopicMessageStore
in interface PersistenceAdapter
destination
- public TransactionStore createTransactionStore() throws java.io.IOException
PersistenceAdapter
createTransactionStore
in interface PersistenceAdapter
java.io.IOException
public long getLastMessageBrokerSequenceId() throws java.io.IOException
getLastMessageBrokerSequenceId
in interface PersistenceAdapter
java.io.IOException
public void beginTransaction(ConnectionContext context) throws java.io.IOException
PersistenceAdapter
beginTransaction
in interface PersistenceAdapter
java.io.IOException
public void commitTransaction(ConnectionContext context) throws java.io.IOException
PersistenceAdapter
commitTransaction
in interface PersistenceAdapter
java.io.IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public void rollbackTransaction(ConnectionContext context) throws java.io.IOException
PersistenceAdapter
rollbackTransaction
in interface PersistenceAdapter
java.io.IOException
PersistenceAdapter.beginTransaction(ConnectionContext context)
public boolean isPersistentIndex()
public void setPersistentIndex(boolean persistentIndex)
public DataStructure readCommand(Location location) throws java.io.IOException
location
-
java.io.IOException
protected java.io.IOException createWriteException(DataStructure packet, java.lang.Exception e)
protected java.io.IOException createWriteException(java.lang.String command, java.lang.Exception e)
protected java.io.IOException createRecoveryFailedException(java.lang.Exception e)
public Location writeCommand(DataStructure command, boolean syncHint) throws java.io.IOException
command
- syncHint
-
java.io.IOException
public Location writeCommand(DataStructure command, boolean syncHint, boolean forceSync) throws java.io.IOException
java.io.IOException
public void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage)
onUsageChanged
in interface UsageListener
public AMQTransactionStore getTransactionStore()
public void deleteAllMessages() throws java.io.IOException
PersistenceAdapter
deleteAllMessages
in interface PersistenceAdapter
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
protected AsyncDataManager createAsyncDataManager()
protected KahaReferenceStoreAdapter createReferenceStoreAdapter() throws java.io.IOException
java.io.IOException
public AsyncDataManager getAsyncDataManager()
public void setAsyncDataManager(AsyncDataManager asyncDataManager)
public ReferenceStoreAdapter getReferenceStoreAdapter()
public TaskRunnerFactory getTaskRunnerFactory()
public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
public WireFormat getWireFormat()
public void setWireFormat(WireFormat wireFormat)
public SystemUsage getUsageManager()
public void setUsageManager(SystemUsage usageManager)
setUsageManager
in interface PersistenceAdapter
usageManager
- The UsageManager that is controlling the broker's memory usage.public int getMaxCheckpointMessageAddSize()
public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize)
public java.io.File getDirectory()
public void setDirectory(java.io.File directory)
PersistenceAdapter
setDirectory
in interface PersistenceAdapter
public boolean isSyncOnWrite()
public void setSyncOnWrite(boolean syncOnWrite)
public boolean isSyncOnTransaction()
public void setSyncOnTransaction(boolean syncOnTransaction)
public void setReferenceStoreAdapter(ReferenceStoreAdapter referenceStoreAdapter)
referenceStoreAdapter
- the referenceStoreAdapter to setpublic long size()
PersistenceAdapter
size
in interface PersistenceAdapter
public boolean isUseNio()
public void setUseNio(boolean useNio)
public int getMaxFileLength()
public void setMaxFileLength(int maxFileLength)
public long getCleanupInterval()
public void setCleanupInterval(long cleanupInterval)
public long getCheckpointInterval()
public void setCheckpointInterval(long checkpointInterval)
public int getIndexBinSize()
public void setIndexBinSize(int indexBinSize)
public int getIndexKeySize()
public void setIndexKeySize(int indexKeySize)
public int getIndexPageSize()
public int getIndexMaxBinSize()
public void setIndexMaxBinSize(int maxBinSize)
public void setIndexPageSize(int indexPageSize)
public void setIndexLoadFactor(int factor)
public int getIndexLoadFactor()
public int getMaxReferenceFileLength()
public void setMaxReferenceFileLength(int maxReferenceFileLength)
public java.io.File getDirectoryArchive()
public void setDirectoryArchive(java.io.File directoryArchive)
public boolean isArchiveDataLogs()
public void setArchiveDataLogs(boolean archiveDataLogs)
public boolean isDisableLocking()
public void setDisableLocking(boolean disableLocking)
public boolean isRecoverReferenceStore()
public void setRecoverReferenceStore(boolean recoverReferenceStore)
recoverReferenceStore
- the recoverReferenceStore to setpublic boolean isForceRecoverReferenceStore()
public void setForceRecoverReferenceStore(boolean forceRecoverReferenceStore)
forceRecoverReferenceStore
- the forceRecoverReferenceStore to setpublic boolean isUseDedicatedTaskRunner()
public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner)
public int getJournalThreadPriority()
public void setJournalThreadPriority(int journalThreadPriority)
journalThreadPriority
- the journalThreadPriority to setprotected void addInProgressDataFile(AMQMessageStore store, int dataFileId)
protected void removeInProgressDataFile(AMQMessageStore store, int dataFileId)
protected void lock() throws java.lang.Exception
java.lang.Exception
protected boolean doLock() throws java.io.IOException
java.io.IOException
public long getLastProducerSequenceId(ProducerId id)
PersistenceAdapter
getLastProducerSequenceId
in interface PersistenceAdapter
id
- the producerId to find a sequenceId for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |