Class KahaDBPersistenceAdapter

    • Constructor Detail

      • KahaDBPersistenceAdapter

        public KahaDBPersistenceAdapter()
    • Method Detail

      • beginTransaction

        public void beginTransaction​(ConnectionContext context)
                              throws IOException
        Description copied from interface: PersistenceAdapter
        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.

        Typically one transaction will require one disk synchronization point and so for real high performance its usually faster to perform many writes within the same transaction to minimize latency caused by disk synchronization. This is especially true when using tools like Berkeley Db or embedded JDBC servers.

        Specified by:
        beginTransaction in interface PersistenceAdapter
        Parameters:
        context -
        Throws:
        IOException
        See Also:
        PersistenceAdapter.beginTransaction(org.apache.activemq.broker.ConnectionContext)
      • getLastProducerSequenceId

        public long getLastProducerSequenceId​(ProducerId id)
                                       throws IOException
        Description copied from interface: PersistenceAdapter
        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
        Specified by:
        getLastProducerSequenceId in interface PersistenceAdapter
        Parameters:
        id - the producerId to find a sequenceId for
        Returns:
        the last stored sequence id or -1 if no suppression needed
        Throws:
        IOException
      • getJournalMaxFileLength

        public int getJournalMaxFileLength()
        Get the journalMaxFileLength
        Specified by:
        getJournalMaxFileLength in interface JournaledStore
        Returns:
        the journalMaxFileLength
      • setJournalMaxFileLength

        public void setJournalMaxFileLength​(int journalMaxFileLength)
        When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
      • setMaxFailoverProducersToTrack

        public void setMaxFailoverProducersToTrack​(int maxFailoverProducersToTrack)
        Set the max number of producers (LRU cache) to track for duplicate sends
      • getMaxFailoverProducersToTrack

        public int getMaxFailoverProducersToTrack()
      • setFailoverProducersAuditDepth

        public void setFailoverProducersAuditDepth​(int failoverProducersAuditDepth)
        set the audit window depth for duplicate suppression (should exceed the max transaction batch)
      • getFailoverProducersAuditDepth

        public int getFailoverProducersAuditDepth()
      • getCheckpointInterval

        public long getCheckpointInterval()
        Get the checkpointInterval
        Returns:
        the checkpointInterval
      • setCheckpointInterval

        public void setCheckpointInterval​(long checkpointInterval)
        Set the checkpointInterval
        Parameters:
        checkpointInterval - the checkpointInterval to set
      • getCleanupInterval

        public long getCleanupInterval()
        Get the cleanupInterval
        Returns:
        the cleanupInterval
      • setCleanupInterval

        public void setCleanupInterval​(long cleanupInterval)
        Set the cleanupInterval
        Parameters:
        cleanupInterval - the cleanupInterval to set
      • getIndexWriteBatchSize

        public int getIndexWriteBatchSize()
        Get the indexWriteBatchSize
        Returns:
        the indexWriteBatchSize
      • setIndexWriteBatchSize

        public void setIndexWriteBatchSize​(int indexWriteBatchSize)
        Set the indexWriteBatchSize When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
        Parameters:
        indexWriteBatchSize - the indexWriteBatchSize to set
      • getJournalMaxWriteBatchSize

        public int getJournalMaxWriteBatchSize()
        Get the journalMaxWriteBatchSize
        Returns:
        the journalMaxWriteBatchSize
      • setJournalMaxWriteBatchSize

        public void setJournalMaxWriteBatchSize​(int journalMaxWriteBatchSize)
        Set the journalMaxWriteBatchSize * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
        Parameters:
        journalMaxWriteBatchSize - the journalMaxWriteBatchSize to set
      • isEnableIndexWriteAsync

        public boolean isEnableIndexWriteAsync()
        Get the enableIndexWriteAsync
        Returns:
        the enableIndexWriteAsync
      • setEnableIndexWriteAsync

        public void setEnableIndexWriteAsync​(boolean enableIndexWriteAsync)
        Set the enableIndexWriteAsync
        Parameters:
        enableIndexWriteAsync - the enableIndexWriteAsync to set
      • getPersistenceAdapterStatistics

        public PersistenceAdapterStatistics getPersistenceAdapterStatistics()
        Get the PersistenceAdapterStatistics
        Returns:
        the persistenceAdapterStatistics
      • getIndexDirectory

        public File getIndexDirectory()
        Returns:
        the currently configured location of the KahaDB index files.
      • setIndexDirectory

        public void setIndexDirectory​(File indexDirectory)
        Sets the directory where KahaDB index files should be written.
        Parameters:
        indexDirectory - the directory where the KahaDB store index files should be written.
      • isEnableJournalDiskSyncs

        public boolean isEnableJournalDiskSyncs()
        Deprecated.
        Get the enableJournalDiskSyncs
        Returns:
        the enableJournalDiskSyncs
      • setEnableJournalDiskSyncs

        public void setEnableJournalDiskSyncs​(boolean enableJournalDiskSyncs)
        Set the enableJournalDiskSyncs
        Parameters:
        enableJournalDiskSyncs - the enableJournalDiskSyncs to set
      • getJournalDiskSyncStrategy

        public String getJournalDiskSyncStrategy()
        Returns:
      • setJournalDiskSyncStrategy

        public void setJournalDiskSyncStrategy​(String journalDiskSyncStrategy)
        Parameters:
        journalDiskSyncStrategy -
      • getJournalDiskSyncInterval

        public long getJournalDiskSyncInterval()
        Returns:
      • setJournalDiskSyncInterval

        public void setJournalDiskSyncInterval​(long journalDiskSyncInterval)
        Parameters:
        journalDiskSyncInterval -
      • getIndexCacheSize

        public int getIndexCacheSize()
        Get the indexCacheSize
        Returns:
        the indexCacheSize
      • setIndexCacheSize

        public void setIndexCacheSize​(int indexCacheSize)
        Set the indexCacheSize When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
        Parameters:
        indexCacheSize - the indexCacheSize to set
      • isIgnoreMissingJournalfiles

        public boolean isIgnoreMissingJournalfiles()
        Get the ignoreMissingJournalfiles
        Returns:
        the ignoreMissingJournalfiles
      • setIgnoreMissingJournalfiles

        public void setIgnoreMissingJournalfiles​(boolean ignoreMissingJournalfiles)
        Set the ignoreMissingJournalfiles
        Parameters:
        ignoreMissingJournalfiles - the ignoreMissingJournalfiles to set
      • isChecksumJournalFiles

        public boolean isChecksumJournalFiles()
      • isCheckForCorruptJournalFiles

        public boolean isCheckForCorruptJournalFiles()
      • setChecksumJournalFiles

        public void setChecksumJournalFiles​(boolean checksumJournalFiles)
      • setCheckForCorruptJournalFiles

        public void setCheckForCorruptJournalFiles​(boolean checkForCorruptJournalFiles)
      • getPurgeRecoveredXATransactionStrategy

        public String getPurgeRecoveredXATransactionStrategy()
      • setPurgeRecoveredXATransactionStrategy

        public void setPurgeRecoveredXATransactionStrategy​(String purgeRecoveredXATransactionStrategy)
      • getPreallocationScope

        public String getPreallocationScope()
      • setPreallocationScope

        public void setPreallocationScope​(String preallocationScope)
      • getPreallocationStrategy

        public String getPreallocationStrategy()
      • setPreallocationStrategy

        public void setPreallocationStrategy​(String preallocationStrategy)
      • isArchiveDataLogs

        public boolean isArchiveDataLogs()
      • setArchiveDataLogs

        public void setArchiveDataLogs​(boolean archiveDataLogs)
      • getDirectoryArchive

        public File getDirectoryArchive()
      • setDirectoryArchive

        public void setDirectoryArchive​(File directoryArchive)
      • isConcurrentStoreAndDispatchQueues

        public boolean isConcurrentStoreAndDispatchQueues()
      • setConcurrentStoreAndDispatchQueues

        public void setConcurrentStoreAndDispatchQueues​(boolean concurrentStoreAndDispatch)
      • isConcurrentStoreAndDispatchTopics

        public boolean isConcurrentStoreAndDispatchTopics()
      • setConcurrentStoreAndDispatchTopics

        public void setConcurrentStoreAndDispatchTopics​(boolean concurrentStoreAndDispatch)
      • getMaxAsyncJobs

        public int getMaxAsyncJobs()
      • setMaxAsyncJobs

        public void setMaxAsyncJobs​(int maxAsyncJobs)
        Parameters:
        maxAsyncJobs - the maxAsyncJobs to set
      • getForceRecoverIndex

        public boolean getForceRecoverIndex()
      • setForceRecoverIndex

        public void setForceRecoverIndex​(boolean forceRecoverIndex)
      • isArchiveCorruptedIndex

        public boolean isArchiveCorruptedIndex()
      • setArchiveCorruptedIndex

        public void setArchiveCorruptedIndex​(boolean archiveCorruptedIndex)
      • getIndexLFUEvictionFactor

        public float getIndexLFUEvictionFactor()
      • setIndexLFUEvictionFactor

        public void setIndexLFUEvictionFactor​(float indexLFUEvictionFactor)
      • isUseIndexLFRUEviction

        public boolean isUseIndexLFRUEviction()
      • setUseIndexLFRUEviction

        public void setUseIndexLFRUEviction​(boolean useIndexLFRUEviction)
      • setEnableIndexDiskSyncs

        public void setEnableIndexDiskSyncs​(boolean diskSyncs)
      • isEnableIndexDiskSyncs

        public boolean isEnableIndexDiskSyncs()
      • setEnableIndexRecoveryFile

        public void setEnableIndexRecoveryFile​(boolean enable)
      • isEnableIndexRecoveryFile

        public boolean isEnableIndexRecoveryFile()
      • setEnableIndexPageCaching

        public void setEnableIndexPageCaching​(boolean enable)
      • isEnableIndexPageCaching

        public boolean isEnableIndexPageCaching()
      • getCompactAcksAfterNoGC

        public int getCompactAcksAfterNoGC()
      • setCompactAcksAfterNoGC

        public void setCompactAcksAfterNoGC​(int compactAcksAfterNoGC)
        Sets the number of GC cycles where no journal logs were removed before an attempt to move forward all the acks in the last log that contains them and is otherwise unreferenced.

        A value of -1 will disable this feature.

        Parameters:
        compactAcksAfterNoGC - Number of empty GC cycles before we rewrite old ACKS.
      • isCompactAcksIgnoresStoreGrowth

        public boolean isCompactAcksIgnoresStoreGrowth()
      • setCompactAcksIgnoresStoreGrowth

        public void setCompactAcksIgnoresStoreGrowth​(boolean compactAcksIgnoresStoreGrowth)
        Configure if Ack compaction will occur regardless of continued growth of the journal logs meaning that the store has not run out of space yet. Because the compaction operation can be costly this value is defaulted to off and the Ack compaction is only done when it seems that the store cannot grow and larger.
        Parameters:
        compactAcksIgnoresStoreGrowth - the compactAcksIgnoresStoreGrowth to set
      • isEnableAckCompaction

        public boolean isEnableAckCompaction()
        Returns whether Ack compaction is enabled
        Returns:
        enableAckCompaction
      • setEnableAckCompaction

        public void setEnableAckCompaction​(boolean enableAckCompaction)
        Configure if the Ack compaction task should be enabled to run
        Parameters:
        enableAckCompaction -
      • isEnableSubscriptionStatistics

        public boolean isEnableSubscriptionStatistics()
        Whether non-blocking subscription statistics have been enabled
        Returns:
      • setEnableSubscriptionStatistics

        public void setEnableSubscriptionStatistics​(boolean enableSubscriptionStatistics)
        Enable caching statistics for each subscription to allow non-blocking retrieval of metrics. This could incur some overhead to compute if there are a lot of subscriptions.
        Parameters:
        enableSubscriptionStatistics -
      • setCleanupOnStop

        public void setCleanupOnStop​(boolean cleanupOnStop)
      • getCleanupOnStop

        public boolean getCleanupOnStop()