public class ThreadLocalSearcherCache extends Object implements SearcherCache
JiraThreadLocalUtils.wrap(Runnable)
or
JiraThreadLocalUtils.wrap(java.util.concurrent.Callable)
Constructor and Description |
---|
ThreadLocalSearcherCache(IssueIndexer issueIndexer,
IndexingConfiguration indexingConfiguration) |
Modifier and Type | Method and Description |
---|---|
static void |
checkClosed(boolean forceClose)
This can be triggered when we are sure the context should be closed.
|
ManagedIndexSearcher |
getSearcher(IndexDirectoryFactory.Name index) |
static boolean |
inSearcherContext() |
static void |
internalCloseSearchers() |
static void |
startSearcherContext() |
static void |
stopAndCloseSearcherContext() |
static void |
stopSearcherContext()
Deprecated.
use
stopAndCloseSearcherContext() ; should only be used in JIRA core internally; |
public ThreadLocalSearcherCache(IssueIndexer issueIndexer, IndexingConfiguration indexingConfiguration)
@Nonnull public ManagedIndexSearcher getSearcher(IndexDirectoryFactory.Name index)
getSearcher
in interface SearcherCache
public static void startSearcherContext()
public static void stopAndCloseSearcherContext()
public static void checkClosed(boolean forceClose)
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 contextforceClose
- when true force close the context@Deprecated public static void stopSearcherContext()
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()
.public static boolean inSearcherContext()
public static void internalCloseSearchers()
Copyright © 2002-2021 Atlassian. All Rights Reserved.