com.atlassian.jira.mock.issue.index
Class MockIssueIndexer

java.lang.Object
  extended by com.atlassian.jira.mock.issue.index.MockIssueIndexer
All Implemented Interfaces:
IssueIndexer

@ThreadSafe
public class MockIssueIndexer
extends Object
implements IssueIndexer

Mock issue indexer that records calls indexing methods for verification.

Since:
v4.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.issue.index.IssueIndexer
IssueIndexer.Analyzers
 
Field Summary
 Collection<Issue> indexedIssues
           
 int indexWorkTime
           
 AtomicInteger optimizations
           
 int optimizationWorkTime
           
 Collection<Issue> reIndexedIssues
           
 
Constructor Summary
MockIssueIndexer()
           
MockIssueIndexer(int indexSleepTime, int optimizationSleepTime)
           
 
Method Summary
 Index.Result deindexIssues(EnclosedIterable<Issue> issues, Context context)
          Delete any existing documents for the supplied issues.
 void deleteIndexes()
           
 org.apache.lucene.search.IndexSearcher getChangeHistorySearcher()
           
 org.apache.lucene.search.IndexSearcher getCommentSearcher()
           
 List<String> getIndexPaths()
           
 String getIndexRootPath()
           
 org.apache.lucene.search.IndexSearcher getIssueSearcher()
           
 Index.Result indexIssues(EnclosedIterable<Issue> issues, Context context)
          Add documents for the supplied issues.
 Index.Result indexIssuesBatchMode(EnclosedIterable<Issue> issues, Context context)
          Index the given issues, use whatever is in your arsenal to do it as FAST as possible.
 Index.Result optimize()
           
 Index.Result reindexComments(Collection<Comment> comments, Context context)
          Reindex a collection of issue comments.
 Index.Result reindexIssues(EnclosedIterable<Issue> issues, Context context, boolean reIndexComments, boolean reIndexChangeHistory, boolean conditionalUpdate)
          Re-index the given issues, delete any existing documents and add new ones.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexWorkTime

public final int indexWorkTime

optimizationWorkTime

public final int optimizationWorkTime

indexedIssues

public final Collection<Issue> indexedIssues

reIndexedIssues

public final Collection<Issue> reIndexedIssues

optimizations

public final AtomicInteger optimizations
Constructor Detail

MockIssueIndexer

public MockIssueIndexer()

MockIssueIndexer

public MockIssueIndexer(int indexSleepTime,
                        int optimizationSleepTime)
Method Detail

indexIssues

public Index.Result indexIssues(@NotNull
                                EnclosedIterable<Issue> issues,
                                @NotNull
                                Context context)
Description copied from interface: IssueIndexer
Add documents for the supplied issues.

Specified by:
indexIssues in interface IssueIndexer
Parameters:
issues - An iterable of issues to index.
context - for showing the user the current status.

deindexIssues

public Index.Result deindexIssues(@NotNull
                                  EnclosedIterable<Issue> issues,
                                  @NotNull
                                  Context context)
Description copied from interface: IssueIndexer
Delete any existing documents for the supplied issues.

Specified by:
deindexIssues in interface IssueIndexer
Parameters:
issues - An iterable of issues to index.
context - for showing the user the current status.

reindexIssues

public Index.Result reindexIssues(@NotNull
                                  EnclosedIterable<Issue> issues,
                                  @NotNull
                                  Context context,
                                  boolean reIndexComments,
                                  boolean reIndexChangeHistory,
                                  boolean conditionalUpdate)
Description copied from interface: IssueIndexer
Re-index the given issues, delete any existing documents and add new ones.

Specified by:
reindexIssues in interface IssueIndexer
Parameters:
issues - An iterable of issues to index.
context - for showing the user the current status.
reIndexComments - Set to true if you require issue comments to also be reindexed.
reIndexChangeHistory - Set to true if you require issue change history to also be reindexed.
conditionalUpdate - set to true to use conditional updates when writing to the index

indexIssuesBatchMode

public Index.Result indexIssuesBatchMode(@NotNull
                                         EnclosedIterable<Issue> issues,
                                         @NotNull
                                         Context context)
Description copied from interface: IssueIndexer
Index the given issues, use whatever is in your arsenal to do it as FAST as possible.

Specified by:
indexIssuesBatchMode in interface IssueIndexer
Parameters:
issues - An iterable of issues to index.
context - for showing the user the current status.

reindexComments

public Index.Result reindexComments(@NotNull
                                    Collection<Comment> comments,
                                    @NotNull
                                    Context context)
Description copied from interface: IssueIndexer
Reindex a collection of issue comments.

Specified by:
reindexComments in interface IssueIndexer
Parameters:
comments - Comments to be reindexed.
context - for showing the user the current status.

optimize

public Index.Result optimize()
Specified by:
optimize in interface IssueIndexer

deleteIndexes

public void deleteIndexes()
Specified by:
deleteIndexes in interface IssueIndexer

shutdown

public void shutdown()
Specified by:
shutdown in interface IssueIndexer

getIssueSearcher

public org.apache.lucene.search.IndexSearcher getIssueSearcher()
Specified by:
getIssueSearcher in interface IssueIndexer

getCommentSearcher

public org.apache.lucene.search.IndexSearcher getCommentSearcher()
Specified by:
getCommentSearcher in interface IssueIndexer

getChangeHistorySearcher

public org.apache.lucene.search.IndexSearcher getChangeHistorySearcher()
Specified by:
getChangeHistorySearcher in interface IssueIndexer

getIndexPaths

public List<String> getIndexPaths()
Specified by:
getIndexPaths in interface IssueIndexer

getIndexRootPath

public String getIndexRootPath()
Specified by:
getIndexRootPath in interface IssueIndexer


Copyright © 2002-2013 Atlassian. All Rights Reserved.