public abstract 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 Set<String> |
ackedAndPrepared |
protected boolean |
archiveDataLogs |
protected BrokerService |
brokerService |
protected Thread |
checkpointThread |
static File |
DEFAULT_DIRECTORY |
protected boolean |
deleteAllMessages |
protected File |
directory |
protected File |
directoryArchive |
protected boolean |
enableJournalDiskSyncs |
protected boolean |
failIfDatabaseIsLocked |
protected boolean |
forceRecoverIndex |
protected ReentrantReadWriteLock |
indexLock |
protected Journal |
journal |
static int |
LOG_SLOW_ACCESS_TIME |
protected MessageDatabase.Metadata |
metadata |
protected org.apache.activemq.store.kahadb.MessageDatabase.MetadataMarshaller |
metadataMarshaller |
protected AtomicBoolean |
opened |
protected PageFile |
pageFile |
protected LinkedHashMap<TransactionId,List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> |
preparedTransactions |
static String |
PROPERTY_LOG_SLOW_ACCESS_TIME |
protected 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) |
void |
forgetRecoveredAcks(ArrayList<MessageAck> acks) |
long |
getCheckpointInterval() |
long |
getCleanupInterval() |
int |
getDatabaseLockedWaitDelay() |
File |
getDirectory() |
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() |
float |
getIndexLFUEvictionFactor() |
int |
getIndexWriteBatchSize() |
Journal |
getJournal() |
HashSet<Integer> |
getJournalFilesBeingReplicated() |
int |
getJournalMaxFileLength() |
int |
getJournalMaxWriteBatchSize() |
org.apache.activemq.store.kahadb.MessageDatabase.LastAck |
getLastAck(Transaction tx,
org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd,
String subscriptionKey) |
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) |
long |
getStoredMessageCount(Transaction tx,
org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd,
String subscriptionKey) |
void |
incrementalRecover() |
boolean |
isArchiveCorruptedIndex() |
boolean |
isArchiveDataLogs() |
boolean |
isCheckForCorruptJournalFiles() |
boolean |
isChecksumJournalFiles() |
boolean |
isDeleteAllMessages() |
boolean |
isEnableIndexDiskSyncs() |
boolean |
isEnableIndexPageCaching() |
boolean |
isEnableIndexRecoveryFile() |
boolean |
isEnableJournalDiskSyncs() |
boolean |
isFailIfDatabaseIsLocked() |
boolean |
isIgnoreMissingJournalfiles() |
boolean |
isRewriteOnRedelivery() |
boolean |
isUseIndexLFRUEviction() |
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,
Runnable after) |
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 |
processLocation(Location location) |
protected void |
recoverIndex(Transaction tx) |
void |
setArchiveCorruptedIndex(boolean archiveCorruptedIndex) |
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(File directory) |
void |
setDirectoryArchive(File directoryArchive) |
void |
setEnableIndexDiskSyncs(boolean enableIndexDiskSyncs) |
void |
setEnableIndexPageCaching(boolean enableIndexPageCaching) |
void |
setEnableIndexRecoveryFile(boolean enableIndexRecoveryFile) |
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 |
setIndexLFUEvictionFactor(float indexLFUEvictionFactor) |
void |
setIndexWriteBatchSize(int setIndexWriteBatchSize) |
void |
setJournalMaxFileLength(int journalMaxFileLength) |
void |
setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize) |
void |
setMaxFailoverProducersToTrack(int maxFailoverProducersToTrack) |
void |
setRewriteOnRedelivery(boolean rewriteOnRedelivery) |
void |
setUseIndexLFRUEviction(boolean useIndexLFRUEviction) |
Location |
store(JournalCommand<?> data) |
Location |
store(JournalCommand<?> data,
boolean sync,
Runnable before,
Runnable after) |
Location |
store(JournalCommand<?> data,
boolean sync,
Runnable before,
Runnable after,
Runnable onJournalStoreComplete)
All updated are are funneled through this method.
|
Location |
store(JournalCommand<?> data,
Runnable onJournalStoreComplete) |
ByteSequence |
toByteSequence(JournalCommand<?> data) |
void |
trackRecoveredAcks(ArrayList<MessageAck> acks) |
void |
unload() |
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
protected BrokerService brokerService
public static final String PROPERTY_LOG_SLOW_ACCESS_TIME
public static final int LOG_SLOW_ACCESS_TIME
public static final File DEFAULT_DIRECTORY
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 Thread checkpointThread
protected boolean enableJournalDiskSyncs
protected boolean archiveDataLogs
protected File directoryArchive
protected AtomicLong storeSize
protected AtomicBoolean opened
protected boolean forceRecoverIndex
protected final ReentrantReadWriteLock indexLock
protected final LinkedHashMap<TransactionId,List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> preparedTransactions
protected final Set<String> ackedAndPrepared
public MessageDatabase()
public void doStart() throws Exception
doStart
in class ServiceSupport
Exception
public void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
public void open() throws IOException
IOException
public LockFile getLockFile()
public void load() throws IOException
IOException
public void close() throws IOException, InterruptedException
IOException
InterruptedException
public void unload() throws IOException, InterruptedException
IOException
InterruptedException
public Location getFirstInProgressTxLocation()
protected void recoverIndex(Transaction tx) throws IOException
IOException
public void incrementalRecover() throws IOException
IOException
public Location getLastUpdatePosition() throws IOException
IOException
protected void checkpointCleanup(boolean cleanup) throws IOException
IOException
public void checkpoint(Callback closure) throws Exception
Exception
public ByteSequence toByteSequence(JournalCommand<?> data) throws IOException
IOException
public Location store(JournalCommand<?> data) throws IOException
IOException
public Location store(JournalCommand<?> data, Runnable onJournalStoreComplete) throws IOException
IOException
public Location store(JournalCommand<?> data, boolean sync, Runnable before, Runnable after) throws IOException
IOException
public Location store(JournalCommand<?> data, boolean sync, Runnable before, Runnable after, Runnable onJournalStoreComplete) throws IOException
IOException
public JournalCommand<?> load(Location location) throws IOException
location
- IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaAddMessageCommand command, Location location) throws IOException
IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand command, Location location) throws IOException
IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaRemoveDestinationCommand command, Location location) throws IOException
IOException
protected void process(org.apache.activemq.store.kahadb.data.KahaSubscriptionCommand command, Location location) throws IOException
IOException
protected void processLocation(Location location)
protected void process(org.apache.activemq.store.kahadb.data.KahaCommitCommand command, Location location, Runnable after) throws IOException
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) throws IOException
IOException
public HashSet<Integer> getJournalFilesBeingReplicated()
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination, Transaction tx) throws IOException
IOException
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getExistingStoredDestination(org.apache.activemq.store.kahadb.data.KahaDestination destination, Transaction tx) throws IOException
IOException
public org.apache.activemq.store.kahadb.MessageDatabase.LastAck getLastAck(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOException
public long getStoredMessageCount(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOException
public void trackRecoveredAcks(ArrayList<MessageAck> acks)
public void forgetRecoveredAcks(ArrayList<MessageAck> acks) throws IOException
IOException
public int getJournalMaxWriteBatchSize()
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize)
public File getDirectory()
public void setDirectory(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 IOException
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 File getDirectoryArchive()
public void setDirectoryArchive(File directoryArchive)
directoryArchive
- the directoryArchive to setpublic int getDatabaseLockedWaitDelay()
public void setDatabaseLockedWaitDelay(int databaseLockedWaitDelay)
databaseLockedWaitDelay
- the databaseLockedWaitDelay to setpublic boolean isRewriteOnRedelivery()
public void setRewriteOnRedelivery(boolean rewriteOnRedelivery)
public boolean isArchiveCorruptedIndex()
public void setArchiveCorruptedIndex(boolean archiveCorruptedIndex)
public float getIndexLFUEvictionFactor()
public void setIndexLFUEvictionFactor(float indexLFUEvictionFactor)
public boolean isUseIndexLFRUEviction()
public void setUseIndexLFRUEviction(boolean useIndexLFRUEviction)
public void setEnableIndexDiskSyncs(boolean enableIndexDiskSyncs)
public void setEnableIndexRecoveryFile(boolean enableIndexRecoveryFile)
public void setEnableIndexPageCaching(boolean enableIndexPageCaching)
public boolean isEnableIndexDiskSyncs()
public boolean isEnableIndexRecoveryFile()
public boolean isEnableIndexPageCaching()
Copyright © 2005–2016. All rights reserved.