use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class GlobalStateTest method testCreateBackendGlobalState.
@Test
public void testCreateBackendGlobalState() throws IOException {
String configFile = String.join("\n", "stateConfig:", " backendType: LOCAL", "stateDir: " + folder.getRoot().getAbsolutePath());
LuceneServerConfiguration configuration = getConfig(configFile);
GlobalState globalState = GlobalState.createState(configuration);
assertTrue(globalState instanceof BackendGlobalState);
}
use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class IndexStateTest method getInitStateVirtualSharding.
public GlobalState getInitStateVirtualSharding() throws IOException {
LuceneServerConfiguration luceneServerConfiguration = LuceneServerTestConfigurationFactory.getConfig(Mode.STANDALONE, folder.getRoot(), "virtualSharding: true");
FieldDefCreator.initialize(luceneServerConfiguration, Collections.emptyList());
SimilarityCreator.initialize(luceneServerConfiguration, Collections.emptyList());
return GlobalState.createState(luceneServerConfiguration);
}
use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class LuceneServerModule method providesLuceneServerConfiguration.
@Inject
@Singleton
@Provides
protected LuceneServerConfiguration providesLuceneServerConfiguration() throws FileNotFoundException {
LuceneServerConfiguration luceneServerConfiguration;
Optional<File> maybeConfigFile = args.maybeConfigFile();
if (maybeConfigFile.isEmpty()) {
luceneServerConfiguration = new LuceneServerConfiguration(getClass().getResourceAsStream(DEFAULT_CONFIG_FILE_RESOURCE));
} else {
luceneServerConfiguration = new LuceneServerConfiguration(new FileInputStream(maybeConfigFile.get()));
}
return luceneServerConfiguration;
}
use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class ScoreScriptTest method setUpGrpcServer.
private GrpcServer setUpGrpcServer(CollectorRegistry collectorRegistry) throws IOException {
String testIndex = "test_index";
LuceneServerConfiguration luceneServerConfiguration = LuceneServerTestConfigurationFactory.getConfig(Mode.STANDALONE, folder.getRoot());
GlobalState globalState = GlobalState.createState(luceneServerConfiguration);
return new GrpcServer(collectorRegistry, grpcCleanup, luceneServerConfiguration, folder, false, globalState, luceneServerConfiguration.getIndexDir(), testIndex, globalState.getPort(), null, Collections.singletonList(new ScoreScriptTestPlugin()));
}
Aggregations