Extract a method for in-memory testing state in Lucene
Change-Id: I84f1290cabb5d9b0c5fdd16a2ca2f82daef7f155
This commit is contained in:
@@ -181,7 +181,7 @@ public class LuceneChangeIndex implements ChangeIndex {
|
||||
queryBuilder = new QueryBuilder(openConfig.getAnalyzer());
|
||||
|
||||
SearcherFactory searcherFactory = new SearcherFactory();
|
||||
if (cfg.getBoolean("index", "lucene", "testInmemory", false)) {
|
||||
if (LuceneIndexModule.isInMemoryTest(cfg)) {
|
||||
openIndex = new SubIndex(new RAMDirectory(), "ramOpen", openConfig,
|
||||
searcherFactory);
|
||||
closedIndex = new SubIndex(new RAMDirectory(), "ramClosed", closedConfig,
|
||||
|
||||
@@ -31,6 +31,10 @@ import org.apache.lucene.search.BooleanQuery;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
|
||||
public class LuceneIndexModule extends LifecycleModule {
|
||||
static boolean isInMemoryTest(Config cfg) {
|
||||
return cfg.getBoolean("index", "lucene", "testInmemory", false);
|
||||
}
|
||||
|
||||
private final Integer singleVersion;
|
||||
private final int threads;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user