public class MessageDatabase extends ServiceSupport implements BrokerServiceAware
Modifier and Type | Class and Description |
---|---|
protected class |
MessageDatabase.LastAckMarshaller |
protected static class |
MessageDatabase.MessageKeysMarshaller |
protected class |
MessageDatabase.Metadata |
protected class |
MessageDatabase.StoredDestinationMarshaller |
Modifier and Type | Field and Description |
---|---|
protected boolean |
archiveDataLogs |
protected BrokerService |
brokerService |
protected java.lang.Thread |
checkpointThread |
protected boolean |
deleteAllMessages |
protected java.io.File |
directory |
protected java.io.File |
directoryArchive |
protected boolean |
enableJournalDiskSyncs |
protected boolean |
failIfDatabaseIsLocked |
protected boolean |
forceRecoverIndex |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
indexLock |
protected java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> |
inflightTransactions |
protected Journal |
journal |
static int |
LOG_SLOW_ACCESS_TIME |
protected MessageDatabase.Metadata |
metadata |
protected org.apache.activemq.store.kahadb.MessageDatabase.MetadataMarshaller |
metadataMarshaller |
protected java.util.concurrent.atomic.AtomicBoolean |
opened |
protected PageFile |
pageFile |
protected java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> |
preparedTransactions |
static java.lang.String |
PROPERTY_LOG_SLOW_ACCESS_TIME |
protected java.util.concurrent.atomic.AtomicLong |
storeSize |
protected static org.apache.activemq.protobuf.Buffer |
UNMATCHED |
Constructor and Description |
---|
MessageDatabase() |
Modifier and Type | Method and Description |
---|---|
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() |
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
protected BrokerService brokerService
public static final java.lang.String PROPERTY_LOG_SLOW_ACCESS_TIME
public static final int LOG_SLOW_ACCESS_TIME
protected static final org.apache.activemq.protobuf.Buffer UNMATCHED
protected MessageDatabase.Metadata metadata
protected org.apache.activemq.store.kahadb.MessageDatabase.MetadataMarshaller metadataMarshaller
protected boolean failIfDatabaseIsLocked
protected boolean deleteAllMessages
protected java.io.File directory
protected java.lang.Thread checkpointThread
protected boolean enableJournalDiskSyncs
protected boolean archiveDataLogs
protected java.io.File directoryArchive
protected java.util.concurrent.atomic.AtomicLong storeSize
protected java.util.concurrent.atomic.AtomicBoolean opened
protected boolean forceRecoverIndex
protected final java.util.concurrent.locks.ReentrantReadWriteLock indexLock
protected final java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> inflightTransactions
protected final java.util.LinkedHashMap<TransactionId,java.util.List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> preparedTransactions
public MessageDatabase()
public void doStart() throws java.lang.Exception
doStart
in class ServiceSupport
java.lang.Exception
public void doStop(ServiceStopper stopper) throws java.lang.Exception
doStop
in class ServiceSupport
java.lang.Exception
public void open() throws java.io.IOException
java.io.IOException
public LockFile getLockFile()
public void load() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void unload() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public Location getFirstInProgressTxLocation()
protected void recoverIndex(Transaction tx) throws java.io.IOException
java.io.IOException
public void incrementalRecover() throws java.io.IOException
java.io.IOException
public Location getLastUpdatePosition() throws java.io.IOException
java.io.IOException
protected void checkpointCleanup(boolean cleanup) throws java.io.IOException
java.io.IOException
public void checkpoint(Callback closure) throws java.lang.Exception
java.lang.Exception
public Location store(JournalCommand<?> data) throws java.io.IOException
java.io.IOException
public Location store(JournalCommand<?> data, boolean sync, java.lang.Runnable before, java.lang.Runnable after) throws java.io.IOException
java.io.IOException
public JournalCommand<?> load(Location location) throws java.io.IOException
location
- java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaAddMessageCommand command, Location location) throws java.io.IOException
java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand command, Location location) throws java.io.IOException
java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveDestinationCommand command, Location location) throws java.io.IOException
java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaSubscriptionCommand command, Location location) throws java.io.IOException
java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaCommitCommand command, Location location) throws java.io.IOException
java.io.IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaPrepareCommand command, Location location)
protected void process(org.apache.activemq.store.kahadb.data.KahaRollbackCommand command, Location location)
public java.util.HashSet<java.lang.Integer> getJournalFilesBeingReplicated()
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination, Transaction tx) throws java.io.IOException
java.io.IOException
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getExistingStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination, Transaction tx) throws java.io.IOException
java.io.IOException
public int getJournalMaxWriteBatchSize()
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
public java.io.File getDirectory()
public void setDirectory(java.io.File directory)
public boolean isDeleteAllMessages()
public void setDeleteAllMessages(boolean deleteAllMessages)
public void setIndexWriteBatchSize(int setIndexWriteBatchSize)
public int getIndexWriteBatchSize()
public void setEnableIndexWriteAsync(boolean enableIndexWriteAsync)
public boolean isEnableJournalDiskSyncs()
public void setEnableJournalDiskSyncs(boolean syncWrites)
public long getCheckpointInterval()
public void setCheckpointInterval(long checkpointInterval)
public long getCleanupInterval()
public void setCleanupInterval(long cleanupInterval)
public void setJournalMaxFileLength(int journalMaxFileLength)
public int getJournalMaxFileLength()
public void setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack)
public int getMaxFailoverProducersToTrack()
public void setFailoverProducersAuditDepth(int failoverProducersAuditDepth)
public int getFailoverProducersAuditDepth()
public PageFile getPageFile()
public Journal getJournal() throws java.io.IOException
java.io.IOException
public boolean isFailIfDatabaseIsLocked()
public void setFailIfDatabaseIsLocked(boolean failIfDatabaseIsLocked)
public boolean isIgnoreMissingJournalfiles()
public void setIgnoreMissingJournalfiles(boolean ignoreMissingJournalfiles)
public int getIndexCacheSize()
public void setIndexCacheSize(int indexCacheSize)
public boolean isCheckForCorruptJournalFiles()
public void setCheckForCorruptJournalFiles(boolean checkForCorruptJournalFiles)
public boolean isChecksumJournalFiles()
public void setChecksumJournalFiles(boolean checksumJournalFiles)
public void setBrokerService(BrokerService brokerService)
setBrokerService
in interface BrokerServiceAware
public boolean isArchiveDataLogs()
public void setArchiveDataLogs(boolean archiveDataLogs)
archiveDataLogs
- the archiveDataLogs to setpublic java.io.File getDirectoryArchive()
public void setDirectoryArchive(java.io.File directoryArchive)
directoryArchive
- the directoryArchive to setpublic int getDatabaseLockedWaitDelay()
public void setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
databaseLockedWaitDelay
- the databaseLockedWaitDelay to setCopyright © 2005-2012. All Rights Reserved.