1
package com.atlassian.jira.plugin.ext.bazaar.revisions;
3
import org.apache.lucene.analysis.Analyzer;
4
import org.apache.lucene.index.IndexReader;
5
import org.apache.lucene.index.IndexWriter;
7
import com.atlassian.jira.issue.index.IndexException;
10
* Small abstraction for Lucene index reader and writer acquisition. Helps
11
* contain the dependencies of RevisionIndexer on the internals of lucene and
12
* specifically the knock-on effects of static references to Bonnie classes in
13
* LuceneUtils. Introduced to aid testability.
16
interface LuceneIndexAccessor {
18
* Gets a Lucene {@link org.apache.lucene.index.IndexReader} at the given
23
* @return the IndexReader.
24
* @throws IndexException
25
* if there's some problem getting the reader.
27
IndexReader getIndexReader(String path) throws IndexException;
30
* Gets a Lucene {@link org.apache.lucene.index.IndexWriter} at the given
36
* if true, then create if absent.
38
* the {@link org.apache.lucene.analysis.Analyzer} to use.
39
* @throws IndexException
40
* if there's some problem getting the writer.
41
* @return the IndexWriter.
43
IndexWriter getIndexWriter(String path, boolean create, Analyzer analyzer)
44
throws IndexException;