Search in sources :

Example 16 with GlobalState

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;
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) GlobalState(com.yelp.nrtsearch.server.luceneserver.GlobalState) PersistentGlobalState(com.yelp.nrtsearch.server.luceneserver.state.PersistentGlobalState)

Example 17 with GlobalState

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());
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) GlobalState(com.yelp.nrtsearch.server.luceneserver.GlobalState)

Example 18 with GlobalState

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);
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) GlobalState(com.yelp.nrtsearch.server.luceneserver.GlobalState)

Example 19 with GlobalState

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()));
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) GlobalState(com.yelp.nrtsearch.server.luceneserver.GlobalState) GrpcServer(com.yelp.nrtsearch.server.grpc.GrpcServer)

Aggregations

GlobalState (com.yelp.nrtsearch.server.luceneserver.GlobalState)19 LuceneServerConfiguration (com.yelp.nrtsearch.server.config.LuceneServerConfiguration)17 PersistentGlobalState (com.yelp.nrtsearch.server.luceneserver.state.PersistentGlobalState)3 AnonymousAWSCredentials (com.amazonaws.auth.AnonymousAWSCredentials)2 AmazonS3Client (com.amazonaws.services.s3.AmazonS3Client)2 ArchiverImpl (com.yelp.nrtsearch.server.backup.ArchiverImpl)2 TarImpl (com.yelp.nrtsearch.server.backup.TarImpl)2 GrpcServer (com.yelp.nrtsearch.server.grpc.GrpcServer)2 Path (java.nio.file.Path)2 Before (org.junit.Before)2 Test (org.junit.Test)2 JsonObject (com.google.gson.JsonObject)1