use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration 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.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class IndexStateTest method getInitState.
public GlobalState getInitState() throws IOException {
LuceneServerConfiguration luceneServerConfiguration = LuceneServerTestConfigurationFactory.getConfig(Mode.STANDALONE, folder.getRoot());
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 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.config.LuceneServerConfiguration in project nrtsearch by Yelp.
the class LuceneServerTest method testQueryCache.
@Test
public void testQueryCache() {
QueryCache queryCache = IndexSearcher.getDefaultQueryCache();
assertTrue(queryCache instanceof NrtQueryCache);
String configStr = String.join("\n", "queryCache:", " enabled: false");
LuceneServerConfiguration configuration = new LuceneServerConfiguration(new ByteArrayInputStream(configStr.getBytes()));
LuceneServerImpl.initQueryCache(configuration);
assertNull(IndexSearcher.getDefaultQueryCache());
configStr = String.join("\n", "queryCache:", " enabled: true");
configuration = new LuceneServerConfiguration(new ByteArrayInputStream(configStr.getBytes()));
LuceneServerImpl.initQueryCache(configuration);
queryCache = IndexSearcher.getDefaultQueryCache();
assertTrue(queryCache instanceof NrtQueryCache);
}
use of com.yelp.nrtsearch.server.config.LuceneServerConfiguration 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);
}
Aggregations