Class ThreadLocalSearcherCache

java.lang.Object
com.atlassian.jira.issue.index.ThreadLocalSearcherCache
All Implemented Interfaces:
SearcherCache

public class ThreadLocalSearcherCache extends Object implements SearcherCache
Low level lucene searcher context. You almost never want to use this. Most of the time you want: JiraThreadLocalUtils.wrap(Runnable) or JiraThreadLocalUtils.wrap(java.util.concurrent.Callable)
  • Constructor Details

  • Method Details

    • getSearcher

      @Nonnull public ManagedIndexSearcher getSearcher(IndexDirectoryFactory.Name index)
      Specified by:
      getSearcher in interface SearcherCache
    • startSearcherContext

      public static void startSearcherContext()
    • stopAndCloseSearcherContext

      public static void stopAndCloseSearcherContext()
    • checkClosed

      public static void checkClosed(boolean forceClose)
      This can be triggered when we are sure the context should be closed. It will log a warning if this is not the case and force close if forceClose is true. This means something went wrong (more startSearcherContext() then stopAndCloseSearcherContext()) on the thread stack and we want to make sure the thread is clean. Note: only call this if you just did a stopAndCloseSearcherContext() and you can not be part of an outer context
      Parameters:
      forceClose - when true force close the context
    • stopSearcherContext

      @Deprecated public static void stopSearcherContext()
      Deprecated.
      use stopAndCloseSearcherContext(); should only be used in JIRA core internally;
      stopSearcherContext() should only be followed by internalCloseSearchers() if searcherContextExists is equal 0; Left for backward compatibility. This method was always followed by internalCloseSearchers().
    • inSearcherContext

      public static boolean inSearcherContext()
    • internalCloseSearchers

      public static void internalCloseSearchers()