public abstract class MessageDatabase extends ServiceSupport implements BrokerServiceAware
| Modifier and Type | Class and Description |
|---|---|
protected class |
MessageDatabase.LastAckMarshaller |
protected class |
MessageDatabase.MessageKeysMarshaller |
protected class |
MessageDatabase.MessageStoreStatisticsMarshaller |
protected class |
MessageDatabase.Metadata |
static class |
MessageDatabase.PurgeRecoveredXATransactionStrategy |
protected class |
MessageDatabase.StoredDestinationMarshaller |
| Constructor and Description |
|---|
MessageDatabase() |
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stopprotected 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 final PersistenceAdapterStatistics persistenceAdapterStatistics
protected org.apache.activemq.store.kahadb.MessageDatabase.MetadataMarshaller metadataMarshaller
protected boolean failIfDatabaseIsLocked
protected boolean deleteAllMessages
protected File indexDirectory
protected ScheduledExecutorService scheduler
protected Journal.JournalDiskSyncStrategy journalDiskSyncStrategy
protected boolean archiveDataLogs
protected File directoryArchive
protected AtomicLong journalSize
protected AtomicBoolean opened
protected MessageDatabase.PurgeRecoveredXATransactionStrategy purgeRecoveredXATransactionStrategy
protected boolean forceRecoverIndex
protected final AtomicReference<Location> lastAsyncJournalUpdate
protected final ReentrantReadWriteLock indexLock
protected final HashMap<String,org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination> storedDestinations
protected final ConcurrentMap<String,MessageStore> storeCache
protected final LinkedHashMap<org.apache.activemq.command.TransactionId,List<org.apache.activemq.store.kahadb.MessageDatabase.Operation>> preparedTransactions
public MessageDatabase()
public void doStart() throws Exception
doStart in class ServiceSupportExceptionpublic void doStop(ServiceStopper stopper) throws Exception
doStop in class ServiceSupportExceptionpublic void allowIOResumption()
public void open() throws IOException
IOExceptionpublic void load() throws IOException
IOExceptionpublic void close() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void unload() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Location[] getInProgressTxLocationRange()
public String getTransactions()
public String getPreparedTransaction(org.apache.activemq.command.TransactionId transactionId)
protected void recoverIndex(Transaction tx) throws IOException
IOExceptionpublic void incrementalRecover() throws IOException
IOExceptionpublic Location getLastUpdatePosition() throws IOException
IOExceptionprotected void checkpointCleanup(boolean cleanup) throws IOException
IOExceptionpublic ByteSequence toByteSequence(JournalCommand<?> data) throws IOException
IOExceptionpublic Location store(JournalCommand<?> data) throws IOException
IOExceptionpublic Location store(JournalCommand<?> data, Runnable onJournalStoreComplete) throws IOException
IOExceptionpublic Location store(JournalCommand<?> data, boolean sync, org.apache.activemq.store.kahadb.MessageDatabase.IndexAware before, Runnable after) throws IOException
IOExceptionpublic Location store(JournalCommand<?> data, boolean sync, org.apache.activemq.store.kahadb.MessageDatabase.IndexAware before, Runnable after, Runnable onJournalStoreComplete) throws IOException
IOExceptionpublic JournalCommand<?> load(Location location) throws IOException
location - IOExceptionprotected void process(KahaAddMessageCommand command, Location location, org.apache.activemq.store.kahadb.MessageDatabase.IndexAware runWithIndexLock) throws IOException
IOExceptionprotected void process(KahaUpdateMessageCommand command, Location location) throws IOException
IOExceptionprotected void process(KahaRemoveMessageCommand command, Location location) throws IOException
IOExceptionprotected void process(KahaRemoveDestinationCommand command, Location location) throws IOException
IOExceptionprotected void process(KahaSubscriptionCommand command, Location location) throws IOException
IOExceptionprotected void processLocation(Location location)
protected void process(KahaCommitCommand command, Location location, org.apache.activemq.store.kahadb.MessageDatabase.IndexAware before) throws IOException
IOExceptionprotected void process(KahaPrepareCommand command, Location location)
protected void process(KahaRollbackCommand command, Location location) throws IOException
IOExceptionprotected void process(KahaRewrittenDataFileCommand command, Location location) throws IOException
IOExceptionpublic HashSet<Integer> getJournalFilesBeingReplicated()
protected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getStoredDestination(KahaDestination destination, Transaction tx) throws IOException
IOExceptionprotected MessageStoreStatistics getStoredMessageStoreStatistics(KahaDestination destination, Transaction tx) throws IOException
IOExceptionprotected org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination getExistingStoredDestination(KahaDestination destination, Transaction tx) throws IOException
IOExceptionprotected void clearStoreStats(KahaDestination kahaDestination)
kahaDestination - protected void incrementAndAddSizeToStoreStat(Transaction tx, KahaDestination kahaDestination, long size) throws IOException
kahaDestination - size - IOExceptionprotected void incrementAndAddSizeToStoreStat(Transaction tx, String kahaDestKey, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, long size) throws IOException
IOExceptionprotected void decrementAndSubSizeToStoreStat(Transaction tx, KahaDestination kahaDestination, long size) throws IOException
IOExceptionprotected void decrementAndSubSizeToStoreStat(Transaction tx, String kahaDestKey, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, long size) throws IOException
IOExceptionprotected void incrementAndAddSizeToStoreStat(KahaDestination kahaDestination, String subKey, long size)
protected void incrementAndAddSizeToStoreStat(String kahaDestKey, String subKey, long size)
protected void decrementAndSubSizeToStoreStat(String kahaDestKey, String subKey, long size)
protected void decrementAndSubSizeToStoreStat(KahaDestination kahaDestination, String subKey, long size)
protected MessageStoreStatistics getStoreStats(String kahaDestKey)
protected MessageStoreSubscriptionStatistics getSubStats(String kahaDestKey)
protected boolean matchType(Destination destination, KahaDestination.DestinationType type)
destination - type - public org.apache.activemq.store.kahadb.MessageDatabase.LastAck getLastAck(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOExceptionprotected SequenceSet getSequenceSet(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOExceptionprotected long getStoredMessageCount(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOExceptionprotected Map<String,AtomicLong> getStoredMessageSize(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, List<String> subscriptionKeys) throws IOException
tx - sd - subscriptionKeys - IOExceptionprotected long getStoredMessageSize(Transaction tx, org.apache.activemq.store.kahadb.MessageDatabase.StoredDestination sd, String subscriptionKey) throws IOException
IOExceptionprotected String key(KahaDestination destination)
protected Journal createJournal() throws IOException
IOExceptionprotected abstract void configureMetadata()
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)
@Deprecated public boolean isEnableJournalDiskSyncs()
getJournalDiskSyncStrategyEnum() or getJournalDiskSyncStrategy() instead@Deprecated public void setEnableJournalDiskSyncs(boolean syncWrites)
setEnableJournalDiskSyncs(boolean) insteadsyncWrites - public Journal.JournalDiskSyncStrategy getJournalDiskSyncStrategyEnum()
public String getJournalDiskSyncStrategy()
public void setJournalDiskSyncStrategy(String journalDiskSyncStrategy)
public long getJournalDiskSyncInterval()
public void setJournalDiskSyncInterval(long journalDiskSyncInterval)
public long getCheckpointInterval()
public void setCheckpointInterval(long checkpointInterval)
public long getCleanupInterval()
public void setCleanupInterval(long cleanupInterval)
public boolean getCleanupOnStop()
public void setCleanupOnStop(boolean cleanupOnStop)
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() throws IOException
IOExceptionpublic Journal getJournal() throws IOException
IOExceptionprotected MessageDatabase.Metadata getMetadata()
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 MessageDatabase.PurgeRecoveredXATransactionStrategy getPurgeRecoveredXATransactionStrategyEnum()
public String getPurgeRecoveredXATransactionStrategy()
public void setPurgeRecoveredXATransactionStrategy(String purgeRecoveredXATransactionStrategy)
public boolean isChecksumJournalFiles()
public void setChecksumJournalFiles(boolean checksumJournalFiles)
public void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic boolean isArchiveDataLogs()
public void setArchiveDataLogs(boolean archiveDataLogs)
archiveDataLogs - the archiveDataLogs to setpublic File getDirectoryArchive()
public void setDirectoryArchive(File directoryArchive)
directoryArchive - the directoryArchive to setpublic 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()
public PersistenceAdapterStatistics getPersistenceAdapterStatistics()
public File getIndexDirectory()
public void setIndexDirectory(File indexDirectory)
public String getPreallocationScope()
public void setPreallocationScope(String preallocationScope)
public String getPreallocationStrategy()
public void setPreallocationStrategy(String preallocationStrategy)
public int getCompactAcksAfterNoGC()
public void setCompactAcksAfterNoGC(int compactAcksAfterNoGC)
A value of -1 will disable this feature.
compactAcksAfterNoGC - Number of empty GC cycles before we rewrite old ACKS.public boolean isCompactAcksIgnoresStoreGrowth()
public void setCompactAcksIgnoresStoreGrowth(boolean compactAcksIgnoresStoreGrowth)
compactAcksIgnoresStoreGrowth - the compactAcksIgnoresStoreGrowth to setpublic boolean isEnableAckCompaction()
public void setEnableAckCompaction(boolean enableAckCompaction)
enableAckCompaction - public boolean isEnableSubscriptionStatistics()
public void setEnableSubscriptionStatistics(boolean enableSubscriptionStatistics)
enableSubscriptionStatistics - Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.