Class IndexingFeaturesImpl

java.lang.Object
com.atlassian.jira.issue.index.IndexingFeaturesImpl
All Implemented Interfaces:
InitializingComponent, IndexingFeatures, org.springframework.beans.factory.DisposableBean

public class IndexingFeaturesImpl extends Object implements IndexingFeatures, InitializingComponent, org.springframework.beans.factory.DisposableBean
  • Constructor Details

    • IndexingFeaturesImpl

      public IndexingFeaturesImpl(JiraProperties jiraProperties, FeatureManager featureManager, com.atlassian.cache.CacheManager cacheManager, com.atlassian.event.api.EventListenerRegistrar eventPublisher, ApplicationProperties applicationProperties)
  • Method Details

    • isCFValueDrivenIndexingEnabled

      public boolean isCFValueDrivenIndexingEnabled()
      Description copied from interface: IndexingFeatures
      Returns true if custom field value driven index is enabled otherwise false.
      Specified by:
      isCFValueDrivenIndexingEnabled in interface IndexingFeatures
    • isLocalContextIndexingEnabled

      public boolean isLocalContextIndexingEnabled()
      Description copied from interface: IndexingFeatures
      Returns true if local context index is enabled otherwise false.
      Specified by:
      isLocalContextIndexingEnabled in interface IndexingFeatures
    • isSkipIndexingNullEnabled

      public boolean isSkipIndexingNullEnabled()
      Description copied from interface: IndexingFeatures
      Returns true if skip indexing null is enabled otherwise false.
      Specified by:
      isSkipIndexingNullEnabled in interface IndexingFeatures
    • isSearchApiEnabled

      public boolean isSearchApiEnabled()
      Description copied from interface: IndexingFeatures
      Returns whether the search API Feature Flag is enabled ("com.atlassian.jira.search.api").
      Specified by:
      isSearchApiEnabled in interface IndexingFeatures
      Returns:
      true if the search API FF is enabled, false otherwise
    • isOpenSearchEnabled

      public boolean isOpenSearchEnabled()
      Description copied from interface: IndexingFeatures
      Checks if OpenSearch is enabled based on the configured search platform.
      Specified by:
      isOpenSearchEnabled in interface IndexingFeatures
      Returns:
      true if OpenSearch is the configured search platform, false otherwise
    • getCustomFieldIndexingBatchSize

      public int getCustomFieldIndexingBatchSize()
      Description copied from interface: IndexingFeatures
      Returns number representing batch size of custom field value retrieval. Never less than 1. Default value is 50. To disable batching set the value to 1.
      Specified by:
      getCustomFieldIndexingBatchSize in interface IndexingFeatures
    • getShouldEmitCacheClearEvent

      public boolean getShouldEmitCacheClearEvent()
      Description copied from interface: IndexingFeatures
      Returns whether the cache clear event should be emitted after indexing. This is used to notify caches that they should clear their entries related to the indexed issues.
      Specified by:
      getShouldEmitCacheClearEvent in interface IndexingFeatures
      Returns:
      true if the cache clear event should be emitted, false otherwise
    • afterInstantiation

      public void afterInstantiation() throws Exception
      Description copied from interface: InitializingComponent
      Called after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.
      Specified by:
      afterInstantiation in interface InitializingComponent
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • onFeatureFlagChange

      @EventListener public void onFeatureFlagChange(FeatureEvent event)
      Reset the Feature Flag cache when a feature flag changed event is received
      Parameters:
      event - the feature flag change event
    • getReindexProcessingQueueSize

      public int getReindexProcessingQueueSize()
      Description copied from interface: IndexingFeatures
      Returns the size of the reindex processing queue. This is used to determine how many issues can be queued for reindexing at once.
      Specified by:
      getReindexProcessingQueueSize in interface IndexingFeatures
      Returns:
      the size of the reindex processing queue
    • setReindexProcessingQueueSize

      public void setReindexProcessingQueueSize(int queueSize)
      Description copied from interface: IndexingFeatures
      Sets the size of the reindex processing queue. This is used to determine how many issues can be queued for reindexing at once.
      Specified by:
      setReindexProcessingQueueSize in interface IndexingFeatures
      Parameters:
      queueSize - the size of the reindex processing queue
    • getReindexProducerThreadPutTimeoutMs

      public int getReindexProducerThreadPutTimeoutMs()
      Description copied from interface: IndexingFeatures
      Returns the timeout for the producer thread when putting issues into the reindexing queue. This is used to determine how long the producer thread will wait to put an issue into the queue before timing out.
      Specified by:
      getReindexProducerThreadPutTimeoutMs in interface IndexingFeatures
      Returns:
      the timeout for putting issues into the reindexing queue in milliseconds
    • getMaxReindexConsumerThreads

      public int getMaxReindexConsumerThreads()
      Description copied from interface: IndexingFeatures
      Returns the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.
      Specified by:
      getMaxReindexConsumerThreads in interface IndexingFeatures
      Returns:
      the maximum number of consumer threads for reindexing
    • setMaxReindexConsumerThreads

      public void setMaxReindexConsumerThreads(int threadCount)
      Description copied from interface: IndexingFeatures
      Sets the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.
      Specified by:
      setMaxReindexConsumerThreads in interface IndexingFeatures
      Parameters:
      threadCount - the maximum number of consumer threads for reindexing
    • getReindexConsumerThreadPollingTimeoutMs

      public int getReindexConsumerThreadPollingTimeoutMs()
      Description copied from interface: IndexingFeatures
      Returns the timeout for polling the reindexing queue. This is used to determine how long to wait for new issues to be added to the queue before timing out.
      Specified by:
      getReindexConsumerThreadPollingTimeoutMs in interface IndexingFeatures
      Returns:
      the timeout for polling the reindexing queue in milliseconds
    • getReindexBulkRequestSize

      public int getReindexBulkRequestSize()
      Description copied from interface: IndexingFeatures
      Returns the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.
      Specified by:
      getReindexBulkRequestSize in interface IndexingFeatures
      Returns:
      the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.
    • setReindexBulkRequestSize

      public void setReindexBulkRequestSize(int bulkRequestSize)
      Description copied from interface: IndexingFeatures
      Sets the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.
      Specified by:
      setReindexBulkRequestSize in interface IndexingFeatures
      Parameters:
      bulkRequestSize - the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.
    • getTermsSetQueryMaxTermsCount

      public int getTermsSetQueryMaxTermsCount()
      Description copied from interface: IndexingFeatures
      Returns the maximum number of terms that can be set in a TermsSetQuery. This is used to prevent hitting the Search Platform's limit on the number of terms that can be set in a TermsSetQuery.
      Specified by:
      getTermsSetQueryMaxTermsCount in interface IndexingFeatures
      Returns:
      the maximum number of terms that can be set in a TermsSetQuery
    • getReindexFailureTolerancePercentage

      public int getReindexFailureTolerancePercentage()
      Description copied from interface: IndexingFeatures
      Returns the percentage of reindex failures that can be tolerated before the reindexing process is considered failed. This is used to determine how many percentage of reindexing failures can be tolerated
      Specified by:
      getReindexFailureTolerancePercentage in interface IndexingFeatures
      Returns:
      the percentage of reindex failures that can be tolerated
    • setReindexFailureTolerancePercentage

      public void setReindexFailureTolerancePercentage(int percentage)
      Description copied from interface: IndexingFeatures
      Sets the value to use for the reindexing fault tolerance.
      Specified by:
      setReindexFailureTolerancePercentage in interface IndexingFeatures
      Parameters:
      percentage - the fault tolerance value
    • isIndexBackupSupported

      public boolean isIndexBackupSupported()
      Description copied from interface: IndexingFeatures
      Returns true if the active Search Platform supports index backup (i.e. Lucene), otherwise false.
      Specified by:
      isIndexBackupSupported in interface IndexingFeatures
      Returns:
      true if index backup is supported, false otherwise
    • getOpenSearchPayloadLimitMb

      public int getOpenSearchPayloadLimitMb()
      Description copied from interface: IndexingFeatures
      Get the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.
      Specified by:
      getOpenSearchPayloadLimitMb in interface IndexingFeatures
      Returns:
      the maximum payload size in MBs
    • setOpenSearchPayloadLimitMb

      public void setOpenSearchPayloadLimitMb(int limitMb)
      Description copied from interface: IndexingFeatures
      Set the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.
      Specified by:
      setOpenSearchPayloadLimitMb in interface IndexingFeatures
      Parameters:
      limitMb - the maximum payload size in MBs
    • isMigratingFromLuceneToOpenSearch

      public boolean isMigratingFromLuceneToOpenSearch()
      Description copied from interface: IndexingFeatures
      Returns whether the Lucene to OpenSearch Feature Flag is enabled ("com.atlassian.jira.migrate.lucene.to.opensearch").
      Specified by:
      isMigratingFromLuceneToOpenSearch in interface IndexingFeatures
      Returns:
      true if enabled, false otherwise
    • isEventuallyConsistent

      public boolean isEventuallyConsistent()
      Description copied from interface: IndexingFeatures
      Get whether the search platform is eventually consistent, which is true when using OpenSearch and "opensearch.force.refresh.on.write" property is false.
      Specified by:
      isEventuallyConsistent in interface IndexingFeatures
      Returns:
      true if the search platform is eventually consistent.