Class OpenSearchProjectReindexServiceImpl

java.lang.Object
com.atlassian.jira.bc.project.index.OpenSearchProjectReindexServiceImpl
All Implemented Interfaces:
ProjectReindexService

public class OpenSearchProjectReindexServiceImpl extends Object
OpenSearch-specific implementation of ProjectReindexService.

This service performs project reindexing without replication and ensures that only one reindexing task runs for a given project across the cluster.

Since:
11.1
  • Field Details

  • Constructor Details

  • Method Details

    • reindex

      public String reindex(Project project)
      Reindexes the specified project without replication.
      Parameters:
      project - the project to reindex
      Returns:
      the progress URL for tracking the reindex operation
    • reindex

      public String reindex(Project project, boolean shouldReplicate)
      User should never call this method in OpenSearch environments.
      Parameters:
      project - the project needs to be re-indexed
      shouldReplicate - whether the index changes should be replicated to the other nodes in the cluster.
      Returns:
      the project reindex progress url
    • getTaskContext

      public ProjectIndexTaskContext getTaskContext(Project project)
      Gets the task context for the given project.

      This method must be implemented by subclasses to provide the appropriate task context based on their specific requirements (e.g., with or without node ID).

      Parameters:
      project - the project to get the task context for
      Returns:
      the task context
    • isReindexPossible

      public boolean isReindexPossible(Project project)
      Specified by:
      isReindexPossible in interface ProjectReindexService
    • getRunningTask

      @Nullable public TaskDescriptor<IndexCommandResult> getRunningTask(Project project)
      Specified by:
      getRunningTask in interface ProjectReindexService
    • getText

      protected String getText(String key, String parameter)
      Gets the localized text for the given key and parameter.
      Parameters:
      key - the text key
      parameter - the parameter to substitute
      Returns:
      the localized text
    • getI18nHelper

      protected I18nHelper getI18nHelper()
      Gets the I18nHelper instance.
      Returns:
      the I18nHelper instance