|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.index.DefaultIndexManager
public class DefaultIndexManager
Field Summary | |
---|---|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_INDEXING
|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_SEARCHING
|
static String |
COMMENTS_SUBDIR
|
static String |
ISSUES_SUBDIR
|
static String |
PLUGINS_SUBDIR
|
Fields inherited from interface com.atlassian.jira.issue.index.IssueIndexManager |
---|
LUCENE_VERSION |
Method Summary | |
---|---|
long |
activate(Context context)
Activates search indexes. |
void |
deactivate()
De-activates indexing (as happens from the admin page) and removes index directories. |
void |
deIndex(org.ofbiz.core.entity.GenericValue entity)
Remove an issue from the search index. |
void |
deIndex(Issue issue)
Remove an issue from the search index. |
static void |
flushThreadLocalSearchers()
|
Collection<String> |
getAllIndexPaths()
|
org.apache.lucene.analysis.Analyzer |
getAnalyzerForIndexing()
Returns an Analyzer for indexing. |
org.apache.lucene.analysis.Analyzer |
getAnalyzerForSearching()
Returns an Analyzer for searching. |
org.apache.lucene.search.IndexSearcher |
getChangeHistorySearcher()
Get an IndexSearcher that can be used to search the change history index. |
org.apache.lucene.search.IndexSearcher |
getCommentSearcher()
Get an IndexSearcher that can be used to search the comment index. |
List<String> |
getExistingPluginsPaths()
Returns a collection of Strings, each one representing the absolute path to the actual existing directory where a plugin keeps its indexes. |
org.apache.lucene.search.IndexSearcher |
getIssueSearcher()
Get an IndexSearcher that can be used to search the issue index. |
String |
getPluginsRootPath()
Get the root path of the index directory for plugins. |
void |
hold()
Temporarily suspend indexing on this thread. |
boolean |
isEmpty()
|
boolean |
isHeld()
Return true if the index is held. |
boolean |
isIndexConsistent()
|
boolean |
isIndexingEnabled()
|
long |
optimize()
Optimize the underlying indexes. |
void |
reIndex(org.ofbiz.core.entity.GenericValue issueGV)
Reindex an issue (eg. |
void |
reIndex(Issue issue)
Reindex an issue (eg. |
void |
reIndex(Issue issue,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex an issue (eg. |
long |
reIndexAll()
Reindex all issues. |
long |
reIndexAll(Context context)
Reindex everything. |
long |
reIndexAll(Context context,
boolean useBackgroundIndexing)
|
long |
reIndexAllIssuesInBackground(Context context)
Reindex everything, but don't stop the world |
long |
reIndexComments(Collection<Comment> comments)
Reindexes a collection of comments. |
long |
reIndexComments(Collection<Comment> comments,
Context context)
Reindexes a collection of comments. |
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects)
Reindex a set of issues. |
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex a set of issues. |
long |
reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues)
Reindex a set of issues (GenericValues). |
protected long |
reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues,
boolean reIndexComments,
boolean reIndexChangeHistory)
|
long |
reIndexIssues(IssuesIterable issuesIterable,
Context context)
Reindex a list of issues, passing an optional event that will be set progress |
long |
reIndexIssues(IssuesIterable issuesIterable,
Context context,
boolean reIndexComments,
boolean reIndexChangeHistory)
Reindex a list of issues, passing an optional event that will be set progress. |
long |
release()
Release indexing on this thread. |
void |
shutdown()
Shuts down the indexing manager and closes its resources (if any). |
int |
size()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
public static final String COMMENTS_SUBDIR
public static final String ISSUES_SUBDIR
public static final String PLUGINS_SUBDIR
Constructor Detail |
---|
public DefaultIndexManager(IndexingConfiguration indexProperties, IssueIndexer issueIndexer, IndexPathManager indexPath, ReindexMessageManager reindexMessageManager, com.atlassian.event.api.EventPublisher eventPublisher, ListenerManager listenerManager, ProjectManager projectManager, FeatureManager featureManager, BarrierFactory barrierFactory, TaskManager taskManager, ApplicationProperties applicationProperties)
DefaultIndexManager(com.atlassian.jira.config.util.IndexingConfiguration, IssueIndexer, com.atlassian.jira.config.util.IndexPathManager, com.atlassian.jira.config.ReindexMessageManager, com.atlassian.event.api.EventPublisher, com.atlassian.jira.event.ListenerManager, com.atlassian.jira.project.ProjectManager, com.atlassian.jira.config.FeatureManager, com.atlassian.jira.concurrent.BarrierFactory, com.atlassian.jira.task.TaskManager, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.ofbiz.OfBizDelegator)
instead. Since v5.2.
public DefaultIndexManager(IndexingConfiguration indexProperties, IssueIndexer issueIndexer, IndexPathManager indexPath, ReindexMessageManager reindexMessageManager, com.atlassian.event.api.EventPublisher eventPublisher, ListenerManager listenerManager, ProjectManager projectManager, FeatureManager featureManager, BarrierFactory barrierFactory, TaskManager taskManager, ApplicationProperties applicationProperties, OfBizDelegator ofBizDelegator)
Method Detail |
---|
public org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
IssueIndexManager
Analyzer
for searching.
getAnalyzerForSearching
in interface IssueIndexManager
public org.apache.lucene.analysis.Analyzer getAnalyzerForIndexing()
IssueIndexManager
Analyzer
for indexing.
getAnalyzerForIndexing
in interface IssueIndexManager
public void deactivate()
IndexLifecycleManager
deactivate
in interface IndexLifecycleManager
public long activate(Context context)
IndexLifecycleManager
activate
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.
public boolean isIndexingEnabled()
isIndexingEnabled
in interface IndexLifecycleManager
public long reIndexAll() throws IndexException
IssueIndexManager
reIndexAll
in interface IssueIndexManager
IndexException
public long reIndexAll(Context context)
IndexLifecycleManager
reIndexAll
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.
public long reIndexAll(Context context, boolean useBackgroundIndexing)
public long reIndexAllIssuesInBackground(Context context)
IndexLifecycleManager
reIndexAllIssuesInBackground
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.
public long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues) throws IndexException
IssueIndexManager
IssueIndexManager.reIndexIssueObjects(Collection)
instead when possible.
reIndexIssues
in interface IssueIndexManager
issues
- The Issue GenericValue
s to reindex.
IndexException
protected long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IndexException
public long reIndexIssueObjects(Collection<? extends Issue> issueObjects) throws IndexException
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.
IndexException
public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.
IndexException
public void reIndex(Issue issue) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexManager
IndexException
public void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexManager
IndexException
public void reIndex(org.ofbiz.core.entity.GenericValue issueGV) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexManager
IndexException
public void hold()
IssueIndexManager
hold
in interface IssueIndexManager
public boolean isHeld()
IssueIndexManager
isHeld
in interface IssueIndexManager
public long release() throws IndexException
IssueIndexManager
release
in interface IssueIndexManager
IndexException
- if an error occurspublic long reIndexIssues(IssuesIterable issuesIterable, Context context) throws IndexException
IssueIndexManager
reIndexIssues
in interface IssueIndexManager
issuesIterable
- IssuesIterablecontext
- used to report progress back to the user or to the logs. Must not be null.
IndexException
public long reIndexIssues(IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
IssueIndexManager
reIndexIssues
in interface IssueIndexManager
issuesIterable
- IssuesIterablecontext
- used to report progress back to the user or to the logs. Must not be null.reIndexComments
- a boolean indicating whether to index issue commentsreIndexChangeHistory
- a boolean indicating whether to index issue change history
IndexException
public long reIndexComments(Collection<Comment> comments) throws IndexException
IssueIndexManager
reIndexComments
in interface IssueIndexManager
comments
- a collection of Comment
IndexException
public long reIndexComments(Collection<Comment> comments, Context context) throws IndexException
IssueIndexManager
reIndexComments
in interface IssueIndexManager
comments
- a collection of Commentcontext
- used to report progress back to the user or to the logs. Must not be null.
IndexException
public boolean isIndexConsistent()
isIndexConsistent
in interface IndexLifecycleManager
false
.public int size()
size
in interface Sized
size
in interface IndexLifecycleManager
IndexLifecycleManager.reIndexAll(Context)
public boolean isEmpty()
isEmpty
in interface Sized
public long optimize()
IndexLifecycleManager
optimize
in interface IndexLifecycleManager
public void deIndex(Issue issue) throws IndexException
IssueIndexManager
deIndex
in interface IssueIndexManager
IndexException
public void deIndex(org.ofbiz.core.entity.GenericValue entity) throws IndexException
IssueIndexManager
deIndex
in interface IssueIndexManager
IndexException
public String getPluginsRootPath()
IssueIndexManager
getPluginsRootPath
in interface IssueIndexManager
public List<String> getExistingPluginsPaths()
IssueIndexManager
IssueIndexManager.getPluginsRootPath()
.
If a plugin index root path does not exist, or is empty (no sub-directopries exist) then an empty collection will be returned.
getExistingPluginsPaths
in interface IssueIndexManager
public Collection<String> getAllIndexPaths()
getAllIndexPaths
in interface IndexLifecycleManager
public org.apache.lucene.search.IndexSearcher getIssueSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the issue index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close()
when you are done with it. Alternatively you should
really call SearchProviderFactory#getSearcher(String))
passing in SearchProviderFactory.ISSUE_INDEX
as it is a managed searcher
and all the closing semantics are handled for you.
getIssueSearcher
in interface IssueIndexManager
public org.apache.lucene.search.IndexSearcher getCommentSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the comment index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close()
when you are done with it. Alternatively you should
really call SearchProviderFactory#getSearcher(String))
passing in SearchProviderFactory.COMMENT_INDEX
as it is a managed
searcher and all the closing semantics are handled for you.
getCommentSearcher
in interface IssueIndexManager
public org.apache.lucene.search.IndexSearcher getChangeHistorySearcher()
IssueIndexManager
IndexSearcher
that can be used to search the change history index.
Note: This is an unmanaged IndexSearcher. You MUST call IndexSearcher.close()
when you are done with it. Alternatively you should
really call SearchProviderFactory#getSearcher(String))
passing in SearchProviderFactory.CHANGE_HISTORY_INDEX
as it is a managed
searcher and all the closing semantics are handled for you.
getChangeHistorySearcher
in interface IssueIndexManager
public void shutdown()
IndexLifecycleManager
shutdown
in interface IndexLifecycleManager
shutdown
in interface Shutdown
public String toString()
toString
in class Object
public static void flushThreadLocalSearchers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |