Package com.atlassian.jira.issue.index
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 Summary
ConstructorsConstructorDescriptionIndexingFeaturesImpl(JiraProperties jiraProperties, FeatureManager featureManager, com.atlassian.cache.CacheManager cacheManager, com.atlassian.event.api.EventListenerRegistrar eventPublisher, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.voiddestroy()intReturns number representing batch size of custom field value retrieval.intReturns the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.intGet the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.intReturns the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.intReturns the timeout for polling the reindexing queue.intReturns the percentage of reindex failures that can be tolerated before the reindexing process is considered failed.intReturns the size of the reindex processing queue.intReturns the timeout for the producer thread when putting issues into the reindexing queue.booleanReturns whether the cache clear event should be emitted after indexing.intReturns the maximum number of terms that can be set in a TermsSetQuery.booleanReturns true if custom field value driven index is enabled otherwise false.booleanGet whether the search platform is eventually consistent, which is true when using OpenSearch and "opensearch.force.refresh.on.write" property is false.booleanReturns true if the active Search Platform supports index backup (i.e.booleanReturns true if local context index is enabled otherwise false.booleanReturns whether the Lucene to OpenSearch Feature Flag is enabled ("com.atlassian.jira.migrate.lucene.to.opensearch").booleanChecks if OpenSearch is enabled based on the configured search platform.booleanReturns whether the search API Feature Flag is enabled ("com.atlassian.jira.search.api").booleanReturns true if skip indexing null is enabled otherwise false.voidonFeatureFlagChange(FeatureEvent event) Reset the Feature Flag cache when a feature flag changed event is receivedvoidsetMaxReindexConsumerThreads(int threadCount) Sets the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.voidsetOpenSearchPayloadLimitMb(int limitMb) Set the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.voidsetReindexBulkRequestSize(int bulkRequestSize) Sets the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.voidsetReindexFailureTolerancePercentage(int percentage) Sets the value to use for the reindexing fault tolerance.voidsetReindexProcessingQueueSize(int queueSize) Sets the size of the reindex processing queue.
-
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:IndexingFeaturesReturns true if custom field value driven index is enabled otherwise false.- Specified by:
isCFValueDrivenIndexingEnabledin interfaceIndexingFeatures
-
isLocalContextIndexingEnabled
public boolean isLocalContextIndexingEnabled()Description copied from interface:IndexingFeaturesReturns true if local context index is enabled otherwise false.- Specified by:
isLocalContextIndexingEnabledin interfaceIndexingFeatures
-
isSkipIndexingNullEnabled
public boolean isSkipIndexingNullEnabled()Description copied from interface:IndexingFeaturesReturns true if skip indexing null is enabled otherwise false.- Specified by:
isSkipIndexingNullEnabledin interfaceIndexingFeatures
-
isSearchApiEnabled
public boolean isSearchApiEnabled()Description copied from interface:IndexingFeaturesReturns whether the search API Feature Flag is enabled ("com.atlassian.jira.search.api").- Specified by:
isSearchApiEnabledin interfaceIndexingFeatures- Returns:
- true if the search API FF is enabled, false otherwise
-
isOpenSearchEnabled
public boolean isOpenSearchEnabled()Description copied from interface:IndexingFeaturesChecks if OpenSearch is enabled based on the configured search platform.- Specified by:
isOpenSearchEnabledin interfaceIndexingFeatures- Returns:
- true if OpenSearch is the configured search platform, false otherwise
-
getCustomFieldIndexingBatchSize
public int getCustomFieldIndexingBatchSize()Description copied from interface:IndexingFeaturesReturns 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:
getCustomFieldIndexingBatchSizein interfaceIndexingFeatures
-
getShouldEmitCacheClearEvent
public boolean getShouldEmitCacheClearEvent()Description copied from interface:IndexingFeaturesReturns 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:
getShouldEmitCacheClearEventin interfaceIndexingFeatures- Returns:
- true if the cache clear event should be emitted, false otherwise
-
afterInstantiation
Description copied from interface:InitializingComponentCalled 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:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
onFeatureFlagChange
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:IndexingFeaturesReturns the size of the reindex processing queue. This is used to determine how many issues can be queued for reindexing at once.- Specified by:
getReindexProcessingQueueSizein interfaceIndexingFeatures- Returns:
- the size of the reindex processing queue
-
setReindexProcessingQueueSize
public void setReindexProcessingQueueSize(int queueSize) Description copied from interface:IndexingFeaturesSets the size of the reindex processing queue. This is used to determine how many issues can be queued for reindexing at once.- Specified by:
setReindexProcessingQueueSizein interfaceIndexingFeatures- Parameters:
queueSize- the size of the reindex processing queue
-
getReindexProducerThreadPutTimeoutMs
public int getReindexProducerThreadPutTimeoutMs()Description copied from interface:IndexingFeaturesReturns 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:
getReindexProducerThreadPutTimeoutMsin interfaceIndexingFeatures- Returns:
- the timeout for putting issues into the reindexing queue in milliseconds
-
getMaxReindexConsumerThreads
public int getMaxReindexConsumerThreads()Description copied from interface:IndexingFeaturesReturns the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.- Specified by:
getMaxReindexConsumerThreadsin interfaceIndexingFeatures- Returns:
- the maximum number of consumer threads for reindexing
-
setMaxReindexConsumerThreads
public void setMaxReindexConsumerThreads(int threadCount) Description copied from interface:IndexingFeaturesSets the maximum number of threads that can be used for consuming issues from the processing queue and indexing them.- Specified by:
setMaxReindexConsumerThreadsin interfaceIndexingFeatures- Parameters:
threadCount- the maximum number of consumer threads for reindexing
-
getReindexConsumerThreadPollingTimeoutMs
public int getReindexConsumerThreadPollingTimeoutMs()Description copied from interface:IndexingFeaturesReturns 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:
getReindexConsumerThreadPollingTimeoutMsin interfaceIndexingFeatures- Returns:
- the timeout for polling the reindexing queue in milliseconds
-
getReindexBulkRequestSize
public int getReindexBulkRequestSize()Description copied from interface:IndexingFeaturesReturns the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.- Specified by:
getReindexBulkRequestSizein interfaceIndexingFeatures- 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:IndexingFeaturesSets the number of issues to process in a single batch when creating the bulk request sent to the Search platform for reindexing.- Specified by:
setReindexBulkRequestSizein interfaceIndexingFeatures- 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:IndexingFeaturesReturns 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:
getTermsSetQueryMaxTermsCountin interfaceIndexingFeatures- Returns:
- the maximum number of terms that can be set in a TermsSetQuery
-
getReindexFailureTolerancePercentage
public int getReindexFailureTolerancePercentage()Description copied from interface:IndexingFeaturesReturns 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:
getReindexFailureTolerancePercentagein interfaceIndexingFeatures- Returns:
- the percentage of reindex failures that can be tolerated
-
setReindexFailureTolerancePercentage
public void setReindexFailureTolerancePercentage(int percentage) Description copied from interface:IndexingFeaturesSets the value to use for the reindexing fault tolerance.- Specified by:
setReindexFailureTolerancePercentagein interfaceIndexingFeatures- Parameters:
percentage- the fault tolerance value
-
isIndexBackupSupported
public boolean isIndexBackupSupported()Description copied from interface:IndexingFeaturesReturns true if the active Search Platform supports index backup (i.e. Lucene), otherwise false.- Specified by:
isIndexBackupSupportedin interfaceIndexingFeatures- Returns:
- true if index backup is supported, false otherwise
-
getOpenSearchPayloadLimitMb
public int getOpenSearchPayloadLimitMb()Description copied from interface:IndexingFeaturesGet the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.- Specified by:
getOpenSearchPayloadLimitMbin interfaceIndexingFeatures- Returns:
- the maximum payload size in MBs
-
setOpenSearchPayloadLimitMb
public void setOpenSearchPayloadLimitMb(int limitMb) Description copied from interface:IndexingFeaturesSet the maximum raw payload size in MB to send to OpenSearch in the bulk index HTTP requests.- Specified by:
setOpenSearchPayloadLimitMbin interfaceIndexingFeatures- Parameters:
limitMb- the maximum payload size in MBs
-
isMigratingFromLuceneToOpenSearch
public boolean isMigratingFromLuceneToOpenSearch()Description copied from interface:IndexingFeaturesReturns whether the Lucene to OpenSearch Feature Flag is enabled ("com.atlassian.jira.migrate.lucene.to.opensearch").- Specified by:
isMigratingFromLuceneToOpenSearchin interfaceIndexingFeatures- Returns:
- true if enabled, false otherwise
-
isEventuallyConsistent
public boolean isEventuallyConsistent()Description copied from interface:IndexingFeaturesGet whether the search platform is eventually consistent, which is true when using OpenSearch and "opensearch.force.refresh.on.write" property is false.- Specified by:
isEventuallyConsistentin interfaceIndexingFeatures- Returns:
- true if the search platform is eventually consistent.
-