Class LexoRankBalancingService

java.lang.Object
com.atlassian.greenhopper.service.lexorank.balance.LexoRankBalancingService

@Service public class LexoRankBalancingService extends Object
Service that handles balancing of lexorank.
  • Constructor Details

    • LexoRankBalancingService

      public LexoRankBalancingService()
  • Method Details

    • onSpringContextStarted

      @PostConstruct public void onSpringContextStarted()
    • onSpringContextStopped

      @PreDestroy public void onSpringContextStopped()
    • initialise

      public void initialise()
      Initialise the service, this will be called when Agile plug is started.
    • pluginFrameworkShuttingDown

      @EventListener public void pluginFrameworkShuttingDown(com.atlassian.plugin.event.events.PluginFrameworkShuttingDownEvent evt)
      Detect Plugin framework shutdown.
    • pluginModuleDisabled

      @EventListener public void pluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent evt)
      Detect JIRA Agile shutdown.
    • onJiraReindexStart

      @EventListener public void onJiraReindexStart(com.atlassian.jira.issue.index.ReindexAllStartedEvent event)
      When jira is reindexing we need to avoid to run the lexorank balancer in this node. If the balancer is running we could get write lock timeouts from lucene.
      Parameters:
      event - the event
    • onJiraReindexComplete

      @EventListener public void onJiraReindexComplete(com.atlassian.jira.issue.index.ReindexAllCompletedEvent event)
      Enable LexoRank balancing when foreground re-indexing stops.
    • isBalancingDisabled

      public boolean isBalancingDisabled()
      Check to see if the service has disabled balancing.
      Returns:
      true when balancing has been disabled.
    • shouldBalancingBackOff

      public boolean shouldBalancingBackOff()
    • onLexoRankEvent

      @EventListener public void onLexoRankEvent(LexoRankChangeEvent event)
      Handle re-rank events, and schedule a re-balance as necessary.
      Parameters:
      event - is the rank event.
    • rankingOperationsDisabled

      public boolean rankingOperationsDisabled(Long fieldId)
      Check to see if rank operations are disabled
      Parameters:
      fieldId - the RANK fieldId
      Returns:
      true when ranking is disabled
    • requestFullBalance

      public ServiceOutcome<Collection<Long>> requestFullBalance()
      Schedule an immediate rebalance for all field ids.
    • requestBalance

      public ServiceOutcome<Collection<Long>> requestBalance(Long rankFieldId)
      Request an immediate rebalance for the specified fieldId
      Parameters:
      rankFieldId -
    • submitScheduledBalance

      public ServiceResult submitScheduledBalance()
      Request a scheduled balance. The balance will not be run if it's already in progress.
    • getExecutorService

      public ThreadPoolExecutor getExecutorService()
    • getBalanceStatus

      Get balancing service status.
      Returns: