use of com.yelp.nrtsearch.server.luceneserver.GlobalState in project nrtsearch by Yelp.
the class RemoteStateBackendTest method getMockGlobalState.
private GlobalState getMockGlobalState(boolean readOnly) throws IOException {
GlobalState mockState = mock(GlobalState.class);
LuceneServerConfiguration serverConfiguration = getConfig(readOnly);
when(mockState.getConfiguration()).thenReturn(serverConfiguration);
when(mockState.getStateDir()).thenReturn(Paths.get(serverConfiguration.getStateDir()));
when(mockState.getIncArchiver()).thenReturn(Optional.of(archiver));
return mockState;
}
use of com.yelp.nrtsearch.server.luceneserver.GlobalState in project nrtsearch by Yelp.
the class LuceneServerIdFieldTest 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.emptyList());
}
use of com.yelp.nrtsearch.server.luceneserver.GlobalState in project nrtsearch by Yelp.
the class ReplicationTestFailureScenarios method startSecondaryServer.
public void startSecondaryServer() throws IOException {
LuceneServerConfiguration luceneSecondaryConfiguration = LuceneServerTestConfigurationFactory.getConfig(Mode.REPLICA, folder.getRoot());
GlobalState globalStateSecondary = GlobalState.createState(luceneSecondaryConfiguration);
luceneServerSecondary = new GrpcServer(grpcCleanup, luceneSecondaryConfiguration, folder, false, globalStateSecondary, luceneSecondaryConfiguration.getIndexDir(), TEST_INDEX, globalStateSecondary.getPort(), archiver);
replicationServerSecondary = new GrpcServer(grpcCleanup, luceneSecondaryConfiguration, folder, true, globalStateSecondary, luceneSecondaryConfiguration.getIndexDir(), TEST_INDEX, globalStateSecondary.getReplicationPort(), archiver);
}
use of com.yelp.nrtsearch.server.luceneserver.GlobalState 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