Class PeriodicIndexWriterCommitScheduler

java.lang.Object
com.atlassian.jira.index.PeriodicIndexWriterCommitScheduler

public class PeriodicIndexWriterCommitScheduler extends Object
Responsible for scheduling cyclical writer commit operation, storing uncommitted writers, and performing the actual commit calls.
  • Field Details

  • Constructor Details

  • Method Details

    • onPluginFrameworkStartedEvent

      @EventListener public void onPluginFrameworkStartedEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event)
    • onPluginFrameworkShutdownEvent

      @EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
    • forceImmediateCommit

      public void forceImmediateCommit() throws ExecutionException, InterruptedException, TimeoutException
      Forces an immediate write of Lucene files to disk. This is not necessary to make changes visible to Jira's search. It must be only used before producing an index snapshot, when we need everything to be physically on the disk before building an archive.
      Throws:
      ExecutionException - will never happen
      InterruptedException
      TimeoutException - when 5 minutes is not enough to write to a disk - indicates a seriously overloaded machine
    • scheduleForCommit

      public void scheduleForCommit(DefaultIndexEngine.WriterReference writer)
      Add writer to commit queue. It s 'commit' method will be called during next iteration of commitWriters()
      Parameters:
      writer -
    • commitWriters

      protected void commitWriters()
      Moves uncommitted writers from commit queue and attempts to commit them. Calls commitObserver on corresponding phases, even if the queue does not contain any writers to commit at the beginning of execution. Never throws an Throwable. In case any exceptions are thrown internally before operation was completed, moves all scheduled writers back to queue.