public class DefaultIndexManager extends Object implements IssueIndexManager
Modifier and Type | Field and Description |
---|---|
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_INDEXING |
static org.apache.lucene.analysis.Analyzer |
ANALYZER_FOR_SEARCHING |
Constructor and Description |
---|
DefaultIndexManager(IndexingConfiguration indexProperties,
IssueIndexer issueIndexer,
IndexPathManager indexPath,
ReindexMessageManager reindexMessageManager,
com.atlassian.event.api.EventPublisher eventPublisher,
ListenerManager listenerManager,
ProjectManager projectManager,
IssueManager issueManager,
TaskManager taskManager,
OfBizDelegator ofBizDelegator,
ReplicatedIndexManager replicatedIndexManager,
ArchivedStatistics archivedStatistics,
SearcherCache searcherCache,
TimeTrackingConfiguration timeTrackingConfiguration,
IndexingLanguageSetting indexingLanguageSetting) |
Modifier and Type | Method and Description |
---|---|
long |
activate(Context context)
Activates search indexes.
|
long |
activate(Context context,
boolean reindex)
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.
|
void |
deIndex(Project project,
boolean updateReplicatedIndexStore)
Deindexing issues from a given project
|
void |
deIndexIssueObjects(Set<Issue> issuesToDelete,
boolean updateReplicatedIndexStore)
Remove a set of issues from the search index.
|
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. |
ManagedIndexSearcher |
getChangeHistorySearcher()
Get an
IndexSearcher that can be used to search the change history index. |
ManagedIndexSearcher |
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.
|
ManagedIndexSearcher |
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.
|
ManagedIndexSearcher |
getWorklogSearcher()
Get an
IndexSearcher that can be used to search the worklog index. |
void |
hold()
Temporarily suspend indexing on this thread.
|
boolean |
isEmpty() |
boolean |
isHeld()
Return true if the index is held.
|
boolean |
isIndexAvailable()
Whether this index is available.
|
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.
|
void |
reIndex(Issue issue,
IssueIndexingParams issueIndexingParams)
Reindex an issue (eg.
|
long |
reIndexAll()
Reindex all issues.
|
long |
reIndexAll(Context context)
Reindex everything.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing) |
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
boolean reIndexComments,
boolean reIndexChangeHistory,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
boolean useBackgroundIndexing,
IssueIndexingParams issueIndexingParams,
boolean updateReplicatedIndex)
Reindex all issues.
|
long |
reIndexAll(Context context,
IssueIndexingParams issueIndexingParams)
Reindex indexes defined by the
IssueIndexingParams . |
long |
reIndexAllIssuesInBackground(Context context)
Reindex everything, but don't stop the world
Comments and change history will not be reindexed.
|
long |
reIndexAllIssuesInBackground(Context context,
boolean reIndexComments,
boolean reIndexChangeHistory)
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 |
reIndexComments(Collection<Comment> comments,
Context context,
boolean updateReplicatedIndexStore)
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 |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
boolean reIndexComments,
boolean reIndexChangeHistory,
boolean updateReplicatedIndexStore)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
IssueIndexingParams issueIndexingParams)
Reindex a set of issues.
|
long |
reIndexIssueObjects(Collection<? extends Issue> issueObjects,
IssueIndexingParams issueIndexingParams,
boolean updateReplicatedIndexStore)
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,
IssueIndexingParams issueIndexingParams) |
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 |
reIndexIssues(IssuesIterable issuesIterable,
Context context,
IssueIndexingParams issueIndexingParams)
Reindex a list of issues, passing an optional event that will be set progress.
|
long |
reIndexIssuesInBackground(Context context,
IssueIndexingParams issueIndexingParams)
Reindex everything, but don't stop the world
|
long |
reIndexWorklogs(Collection<Worklog> worklogs)
Reindexes a collection of worklogs.
|
long |
reIndexWorklogs(Collection<Worklog> worklogs,
Context context)
Reindexes a collection of worklogs.
|
long |
reIndexWorklogs(Collection<Worklog> worklogs,
Context context,
boolean updateReplicatedIndexStore)
Reindexes a collection of worklogs.
|
long |
release()
Release indexing on this thread.
|
void |
shutdown()
Shuts down the indexing manager and closes its resources (if any).
|
int |
size() |
String |
toString() |
boolean |
withReindexLock(Runnable runnable)
This method takes a runnable that is run under the 'stop the world' reindex lock.
|
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
public DefaultIndexManager(IndexingConfiguration indexProperties, IssueIndexer issueIndexer, IndexPathManager indexPath, ReindexMessageManager reindexMessageManager, com.atlassian.event.api.EventPublisher eventPublisher, ListenerManager listenerManager, ProjectManager projectManager, IssueManager issueManager, TaskManager taskManager, OfBizDelegator ofBizDelegator, ReplicatedIndexManager replicatedIndexManager, ArchivedStatistics archivedStatistics, SearcherCache searcherCache, TimeTrackingConfiguration timeTrackingConfiguration, IndexingLanguageSetting indexingLanguageSetting)
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 long activate(Context context, boolean reindex)
IndexLifecycleManager
activate
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.reindex
- reindex after activation.public boolean isIndexingEnabled()
isIndexingEnabled
in interface IndexLifecycleManager
public boolean isIndexAvailable()
IndexLifecycleManager
isIndexAvailable
in interface IndexLifecycleManager
public long reIndexAll() throws IndexException
IssueIndexManager
reIndexAll
in interface IssueIndexingService
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 reIndexAll(Context context, boolean useBackgroundIndexing, boolean updateReplicatedIndex)
IssueIndexManager
reIndexAll
in interface IssueIndexingService
reIndexAll
in interface IssueIndexManager
context
- used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing
- whether to index in the background or not. If the useBackgroundReindexing option
is set to true, then all related fields will not be reindexed.updateReplicatedIndex
- whether to update the replicated index or notpublic long reIndexAll(Context context, boolean useBackgroundIndexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndex)
IssueIndexManager
reIndexAll
in interface IssueIndexManager
context
- used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing
- whether to index in the background or notreIndexComments
- Also reindex all the issue comments. Only relevant for background reindex operations.reIndexChangeHistory
- Also reindex the issue change history. Only relevant for background reindex
operations.updateReplicatedIndex
- whether to update the replicated index or notpublic long reIndexAll(Context context, IssueIndexingParams issueIndexingParams)
IndexLifecycleManager
IssueIndexingParams
.reIndexAll
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.issueIndexingParams
- indexes to reindex.public long reIndexAll(Context context, boolean useBackgroundIndexing, IssueIndexingParams issueIndexingParams, boolean updateReplicatedIndex)
IssueIndexManager
reIndexAll
in interface IssueIndexingService
reIndexAll
in interface IssueIndexManager
context
- used to report progress back to the user or to the logs. Must not be nulluseBackgroundIndexing
- whether to index in the background or notissueIndexingParams
- determines witch related objects should be indexed together with issues. Only relevant
for background reindex operations.updateReplicatedIndex
- whether to update the replicated index or notpublic boolean withReindexLock(Runnable runnable)
withReindexLock
in interface IssueIndexManager
runnable
- The runnable to be executedpublic 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 reIndexAllIssuesInBackground(Context context, boolean reIndexComments, boolean reIndexChangeHistory)
IndexLifecycleManager
reIndexAllIssuesInBackground
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.reIndexComments
- Also reindex all the issue comments.reIndexChangeHistory
- Also reindex the issue change history.public long reIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams)
IndexLifecycleManager
reIndexIssuesInBackground
in interface IndexLifecycleManager
context
- used to report progress back to the user or to the logs. Must not be null.issueIndexingParams
- determines witch related objects should be indexed together with issue.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, IssueIndexingParams issueIndexingParams) throws IndexException
IndexException
public long reIndexIssueObjects(Collection<? extends Issue> issueObjects) throws IndexException
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexingService
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 long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams) throws IndexException
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexingService
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.issueIndexingParams
- Determines witch related objects should be indexed together with issues.IndexException
public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory, boolean updateReplicatedIndexStore)
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.reIndexComments
- whether to reindex the comments or notreIndexChangeHistory
- whether to reindex changeHistory or notupdateReplicatedIndexStore
- whether to store index operations in the replicated index storepublic long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams, boolean updateReplicatedIndexStore)
IssueIndexManager
reIndexIssueObjects
in interface IssueIndexingService
reIndexIssueObjects
in interface IssueIndexManager
issueObjects
- Set of Issue
s to reindex.issueIndexingParams
- Determines witch related objects should be indexed together with issues.updateReplicatedIndexStore
- whether to store index operations in the replicated index storepublic void deIndex(Project project, boolean updateReplicatedIndexStore)
IssueIndexingService
deIndex
in interface IssueIndexingService
project
- project objectupdateReplicatedIndexStore
- whether to store index operations in the replicated index storepublic void reIndex(Issue issue) throws IndexException
IssueIndexManager
reIndex
in interface IssueIndexingService
reIndex
in interface IssueIndexManager
IndexException
public void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)
IssueIndexManager
reIndex
in interface IssueIndexManager
public void reIndex(Issue issue, IssueIndexingParams issueIndexingParams)
IssueIndexManager
reIndex
in interface IssueIndexingService
reIndex
in interface IssueIndexManager
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 IssueIndexingService
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 historyIndexException
public long reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams)
IssueIndexManager
reIndexIssues
in interface IssueIndexingService
reIndexIssues
in interface IssueIndexManager
issuesIterable
- IssuesIterablecontext
- used to report progress back to the user or to the logs. Must not be null.issueIndexingParams
- determines witch related objects should be indexed together with issue.public long reIndexComments(Collection<Comment> comments) throws IndexException
IssueIndexManager
reIndexComments
in interface IssueIndexingService
reIndexComments
in interface IssueIndexManager
comments
- a collection of CommentIndexException
public long reIndexComments(Collection<Comment> comments, Context context) throws IndexException
IssueIndexManager
reIndexComments
in interface IssueIndexingService
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 long reIndexComments(Collection<Comment> comments, Context context, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManager
reIndexComments
in interface IssueIndexingService
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.updateReplicatedIndexStore
- whether to update the replicated index or notIndexException
public long reIndexWorklogs(Collection<Worklog> worklogs) throws IndexException
IssueIndexManager
reIndexWorklogs
in interface IssueIndexingService
reIndexWorklogs
in interface IssueIndexManager
worklogs
- a collection of WorklogsIndexException
public long reIndexWorklogs(Collection<Worklog> worklogs, Context context) throws IndexException
IssueIndexManager
reIndexWorklogs
in interface IssueIndexingService
reIndexWorklogs
in interface IssueIndexManager
worklogs
- a collection of Worklogscontext
- used to report progress back to the user or to the logs. Must not be null.IndexException
public long reIndexWorklogs(Collection<Worklog> worklogs, Context context, boolean updateReplicatedIndexStore) throws IndexException
IssueIndexManager
reIndexWorklogs
in interface IssueIndexingService
reIndexWorklogs
in interface IssueIndexManager
worklogs
- a collection of Worklogscontext
- used to report progress back to the user or to the logs. Must not be null.updateReplicatedIndexStore
- whether to update the replicated index or notIndexException
public boolean isIndexConsistent()
isIndexConsistent
in interface IndexLifecycleManager
false
. Note that false
is also returned if the index
is not available IndexLifecycleManager.isIndexAvailable()
.public int size()
size
in interface Sized
size
in interface IndexLifecycleManager
IndexLifecycleManager.reIndexAll(Context)
public long optimize()
IndexLifecycleManager
optimize
in interface IndexLifecycleManager
public void deIndex(Issue issue) throws IndexException
IssueIndexManager
deIndex
in interface IssueIndexingService
deIndex
in interface IssueIndexManager
IndexException
public void deIndexIssueObjects(Set<Issue> issuesToDelete, boolean updateReplicatedIndexStore)
IssueIndexManager
deIndexIssueObjects
in interface IssueIndexingService
deIndexIssueObjects
in interface IssueIndexManager
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 ManagedIndexSearcher getIssueSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the issue index.getIssueSearcher
in interface IssueIndexManager
public ManagedIndexSearcher getCommentSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the comment index.getCommentSearcher
in interface IssueIndexManager
public ManagedIndexSearcher getChangeHistorySearcher()
IssueIndexManager
IndexSearcher
that can be used to search the change history index.getChangeHistorySearcher
in interface IssueIndexManager
public ManagedIndexSearcher getWorklogSearcher()
IssueIndexManager
IndexSearcher
that can be used to search the worklog index.getWorklogSearcher
in interface IssueIndexManager
public Collection<String> getAllIndexPaths()
getAllIndexPaths
in interface IndexLifecycleManager
public void shutdown()
IndexLifecycleManager
shutdown
in interface IndexLifecycleManager
shutdown
in interface Shutdown
Copyright © 2002-2019 Atlassian. All Rights Reserved.