Package com.atlassian.jira.issue.index
Class ThreadLocalSearcherCache
java.lang.Object
com.atlassian.jira.issue.index.ThreadLocalSearcherCache
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionThreadLocalSearcherCache(IssueIndexer issueIndexer, IndexingConfiguration indexingConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckClosed(boolean forceClose) This can be triggered when we are sure the context should be closed.static booleanstatic voidstatic voidstatic voidstatic voidDeprecated.
-
Constructor Details
-
ThreadLocalSearcherCache
public ThreadLocalSearcherCache(IssueIndexer issueIndexer, IndexingConfiguration indexingConfiguration)
-
-
Method Details
-
getSearcher
- Specified by:
getSearcherin interfaceSearcherCache
-
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 ifforceCloseis true. This means something went wrong (morestartSearcherContext()thenstopAndCloseSearcherContext()) on the thread stack and we want to make sure the thread is clean. Note: only call this if you just did astopAndCloseSearcherContext()and you can not be part of an outer context- Parameters:
forceClose- when true force close the context
-
stopSearcherContext
Deprecated.usestopAndCloseSearcherContext(); should only be used in JIRA core internally;stopSearcherContext()should only be followed byinternalCloseSearchers()ifsearcherContextExistsis equal 0; Left for backward compatibility. This method was always followed byinternalCloseSearchers(). -
inSearcherContext
public static boolean inSearcherContext() -
internalCloseSearchers
public static void internalCloseSearchers()
-
stopAndCloseSearcherContext(); should only be used in JIRA core internally;