Extract a method for in-memory testing state in Lucene

Change-Id: I84f1290cabb5d9b0c5fdd16a2ca2f82daef7f155
This commit is contained in:
Dave Borowitz
2016-03-16 11:56:23 +01:00
parent e1601e4c42
commit 063e852ebc
2 changed files with 5 additions and 1 deletions

View File

@@ -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,

View File

@@ -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;