org.apache.activemq.store.kahadb
Class MessageDatabase
java.lang.Object
org.apache.activemq.util.ServiceSupport
org.apache.activemq.store.kahadb.MessageDatabase
- All Implemented Interfaces:
- BrokerServiceAware, Service
- Direct Known Subclasses:
- KahaDBStore
public class MessageDatabase
- extends ServiceSupport
- implements BrokerServiceAware
Method Summary |
void |
checkpoint(Callback closure)
|
protected void |
checkpointCleanup(boolean cleanup)
|
void |
close()
|
void |
doStart()
|
void |
doStop(ServiceStopper stopper)
|
long |
getCheckpointInterval()
|
long |
getCleanupInterval()
|
int |
getDatabaseLockedWaitDelay()
|
java.io.File |
getDirectory()
|
java.io.File |
getDirectoryArchive()
|
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination |
getExistingStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination,
Transaction tx)
|
int |
getFailoverProducersAuditDepth()
|
Location |
getFirstInProgressTxLocation()
|
int |
getIndexCacheSize()
|
int |
getIndexWriteBatchSize()
|
Journal |
getJournal()
|
java.util.HashSet<java.lang.Integer> |
getJournalFilesBeingReplicated()
|
int |
getJournalMaxFileLength()
|
int |
getJournalMaxWriteBatchSize()
|
Location |
getLastUpdatePosition()
|
LockFile |
getLockFile()
|
int |
getMaxFailoverProducersToTrack()
|
PageFile |
getPageFile()
|
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination |
getStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination,
Transaction tx)
|
void |
incrementalRecover()
|
boolean |
isArchiveDataLogs()
|
boolean |
isCheckForCorruptJournalFiles()
|
boolean |
isChecksumJournalFiles()
|
boolean |
isDeleteAllMessages()
|
boolean |
isEnableJournalDiskSyncs()
|
boolean |
isFailIfDatabaseIsLocked()
|
boolean |
isIgnoreMissingJournalfiles()
|
void |
load()
|
JournalCommand<?> |
load(Location location)
Loads a previously stored JournalMessage |
void |
open()
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaAddMessageCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaCommitCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaPrepareCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaRemoveDestinationCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaRollbackCommand command,
Location location)
|
protected void |
process(org.apache.activemq.store.kahadb.data.KahaSubscriptionCommand command,
Location location)
|
protected void |
recoverIndex(Transaction tx)
|
void |
setArchiveDataLogs(boolean archiveDataLogs)
|
void |
setBrokerService(BrokerService brokerService)
|
void |
setCheckForCorruptJournalFiles(boolean checkForCorruptJournalFiles)
|
void |
setCheckpointInterval(long checkpointInterval)
|
void |
setChecksumJournalFiles(boolean checksumJournalFiles)
|
void |
setCleanupInterval(long cleanupInterval)
|
void |
setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
|
void |
setDeleteAllMessages(boolean deleteAllMessages)
|
void |
setDirectory(java.io.File directory)
|
void |
setDirectoryArchive(java.io.File directoryArchive)
|
void |
setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
|
void |
setEnableJournalDiskSyncs(boolean syncWrites)
|
void |
setFailIfDatabaseIsLocked(boolean failIfDatabaseIsLocked)
|
void |
setFailoverProducersAuditDepth(int failoverProducersAuditDepth)
|
void |
setIgnoreMissingJournalfiles(boolean ignoreMissingJournalfiles)
|
void |
setIndexCacheSize(int indexCacheSize)
|
void |
setIndexWriteBatchSize(int setIndexWriteBatchSize)
|
void |
setJournalMaxFileLength(int journalMaxFileLength)
|
void |
setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
|
void |
setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack)
|
Location |
store(JournalCommand<?> data)
|
Location |
store(JournalCommand<?> data,
boolean sync,
java.lang.Runnable before,
java.lang.Runnable after)
All updated are are funneled through this method. |
void |
unload()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
brokerService
protected BrokerService brokerService
PROPERTY_LOG_SLOW_ACCESS_TIME
public static final java.lang.String PROPERTY_LOG_SLOW_ACCESS_TIME
- See Also:
- Constant Field Values
LOG_SLOW_ACCESS_TIME
public static final int LOG_SLOW_ACCESS_TIME
UNMATCHED
protected static final org.apache.activemq.protobuf.Buffer UNMATCHED
pageFile
protected PageFile pageFile
journal
protected Journal journal
metadata
protected MessageDatabase.Metadata metadata
metadataMarshaller
protected org.apache.activemq.store.kahadb.MessageDatabase.MetadataMarshaller metadataMarshaller
failIfDatabaseIsLocked
protected boolean failIfDatabaseIsLocked
deleteAllMessages
protected boolean deleteAllMessages
directory
protected java.io.File directory
checkpointThread
protected java.lang.Thread checkpointThread
enableJournalDiskSyncs
protected boolean enableJournalDiskSyncs
archiveDataLogs
protected boolean archiveDataLogs
directoryArchive
protected java.io.File directoryArchive
storeSize
protected java.util.concurrent.atomic.AtomicLong storeSize
opened
protected java.util.concurrent.atomic.AtomicBoolean opened
forceRecoverIndex
protected boolean forceRecoverIndex
indexLock
protected final java.util.concurrent.locks.ReentrantReadWriteLock indexLock
inflightTransactions
protected final java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> inflightTransactions
preparedTransactions
protected final java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> preparedTransactions
MessageDatabase
public MessageDatabase()
doStart
public void doStart()
throws java.lang.Exception
- Specified by:
doStart
in class ServiceSupport
- Throws:
java.lang.Exception
doStop
public void doStop(ServiceStopper stopper)
throws java.lang.Exception
- Specified by:
doStop
in class ServiceSupport
- Throws:
java.lang.Exception
open
public void open()
throws java.io.IOException
- Throws:
java.io.IOException
getLockFile
public LockFile getLockFile()
load
public void load()
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException,
java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
unload
public void unload()
throws java.io.IOException,
java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
getFirstInProgressTxLocation
public Location getFirstInProgressTxLocation()
recoverIndex
protected void recoverIndex(Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
incrementalRecover
public void incrementalRecover()
throws java.io.IOException
- Throws:
java.io.IOException
getLastUpdatePosition
public Location getLastUpdatePosition()
throws java.io.IOException
- Throws:
java.io.IOException
checkpointCleanup
protected void checkpointCleanup(boolean cleanup)
throws java.io.IOException
- Throws:
java.io.IOException
checkpoint
public void checkpoint(Callback closure)
throws java.lang.Exception
- Throws:
java.lang.Exception
store
public Location store(JournalCommand<?> data)
throws java.io.IOException
- Throws:
java.io.IOException
store
public Location store(JournalCommand<?> data,
boolean sync,
java.lang.Runnable before,
java.lang.Runnable after)
throws java.io.IOException
- All updated are are funneled through this method. The updates are converted
to a JournalMessage which is logged to the journal and then the data from
the JournalMessage is used to update the index just like it would be done
during a recovery process.
- Throws:
java.io.IOException
load
public JournalCommand<?> load(Location location)
throws java.io.IOException
- Loads a previously stored JournalMessage
- Parameters:
location
-
- Returns:
-
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaAddMessageCommand command,
Location location)
throws java.io.IOException
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand command,
Location location)
throws java.io.IOException
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveDestinationCommand command,
Location location)
throws java.io.IOException
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaSubscriptionCommand command,
Location location)
throws java.io.IOException
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaCommitCommand command,
Location location)
throws java.io.IOException
- Throws:
java.io.IOException
process
protected void process(org.apache.activemq.store.kahadb.data.KahaPrepareCommand command,
Location location)
process
protected void process(org.apache.activemq.store.kahadb.data.KahaRollbackCommand command,
Location location)
getJournalFilesBeingReplicated
public java.util.HashSet<java.lang.Integer> getJournalFilesBeingReplicated()
getStoredDestination
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination,
Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
getExistingStoredDestination
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getExistingStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination,
Transaction tx)
throws java.io.IOException
- Throws:
java.io.IOException
getJournalMaxWriteBatchSize
public int getJournalMaxWriteBatchSize()
setJournalMaxWriteBatchSize
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
getDirectory
public java.io.File getDirectory()
setDirectory
public void setDirectory(java.io.File directory)
isDeleteAllMessages
public boolean isDeleteAllMessages()
setDeleteAllMessages
public void setDeleteAllMessages(boolean deleteAllMessages)
setIndexWriteBatchSize
public void setIndexWriteBatchSize(int setIndexWriteBatchSize)
getIndexWriteBatchSize
public int getIndexWriteBatchSize()
setEnableIndexWriteAsync
public void setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
isEnableJournalDiskSyncs
public boolean isEnableJournalDiskSyncs()
setEnableJournalDiskSyncs
public void setEnableJournalDiskSyncs(boolean syncWrites)
getCheckpointInterval
public long getCheckpointInterval()
setCheckpointInterval
public void setCheckpointInterval(long checkpointInterval)
getCleanupInterval
public long getCleanupInterval()
setCleanupInterval
public void setCleanupInterval(long cleanupInterval)
setJournalMaxFileLength
public void setJournalMaxFileLength(int journalMaxFileLength)
getJournalMaxFileLength
public int getJournalMaxFileLength()
setMaxFailoverProducersToTrack
public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack)
getMaxFailoverProducersToTrack
public int getMaxFailoverProducersToTrack()
setFailoverProducersAuditDepth
public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth)
getFailoverProducersAuditDepth
public int getFailoverProducersAuditDepth()
getPageFile
public PageFile getPageFile()
getJournal
public Journal getJournal()
throws java.io.IOException
- Throws:
java.io.IOException
isFailIfDatabaseIsLocked
public boolean isFailIfDatabaseIsLocked()
setFailIfDatabaseIsLocked
public void setFailIfDatabaseIsLocked(boolean failIfDatabaseIsLocked)
isIgnoreMissingJournalfiles
public boolean isIgnoreMissingJournalfiles()
setIgnoreMissingJournalfiles
public void setIgnoreMissingJournalfiles(boolean ignoreMissingJournalfiles)
getIndexCacheSize
public int getIndexCacheSize()
setIndexCacheSize
public void setIndexCacheSize(int indexCacheSize)
isCheckForCorruptJournalFiles
public boolean isCheckForCorruptJournalFiles()
setCheckForCorruptJournalFiles
public void setCheckForCorruptJournalFiles(boolean checkForCorruptJournalFiles)
isChecksumJournalFiles
public boolean isChecksumJournalFiles()
setChecksumJournalFiles
public void setChecksumJournalFiles(boolean checksumJournalFiles)
setBrokerService
public void setBrokerService(BrokerService brokerService)
- Specified by:
setBrokerService
in interface BrokerServiceAware
isArchiveDataLogs
public boolean isArchiveDataLogs()
- Returns:
- the archiveDataLogs
setArchiveDataLogs
public void setArchiveDataLogs(boolean archiveDataLogs)
- Parameters:
archiveDataLogs
- the archiveDataLogs to set
getDirectoryArchive
public java.io.File getDirectoryArchive()
- Returns:
- the directoryArchive
setDirectoryArchive
public void setDirectoryArchive(java.io.File directoryArchive)
- Parameters:
directoryArchive
- the directoryArchive to set
getDatabaseLockedWaitDelay
public int getDatabaseLockedWaitDelay()
- Returns:
- the databaseLockedWaitDelay
setDatabaseLockedWaitDelay
public void setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
- Parameters:
databaseLockedWaitDelay
- the databaseLockedWaitDelay to set
Copyright © 2005-2012. All Rights Reserved.