Search in sources :

Example 1 with LocalStateBackend

use of com.yelp.nrtsearch.server.luceneserver.state.backend.LocalStateBackend in project nrtsearch by Yelp.

the class BackendGlobalStateTest method testUseLocalBackend.

@Test
public void testUseLocalBackend() throws IOException {
    String configFile = String.join("\n", "stateConfig:", "  backendType: LOCAL", "stateDir: " + folder.newFolder("state").getAbsolutePath(), "indexDir: " + folder.newFolder("index").getAbsolutePath());
    LuceneServerConfiguration config = new LuceneServerConfiguration(new ByteArrayInputStream(configFile.getBytes()));
    BackendGlobalState backendGlobalState = new BackendGlobalState(config, null);
    assertTrue(backendGlobalState.getStateBackend() instanceof LocalStateBackend);
}
Also used : LuceneServerConfiguration(com.yelp.nrtsearch.server.config.LuceneServerConfiguration) ByteArrayInputStream(java.io.ByteArrayInputStream) LocalStateBackend(com.yelp.nrtsearch.server.luceneserver.state.backend.LocalStateBackend) Test(org.junit.Test)

Aggregations

LuceneServerConfiguration (com.yelp.nrtsearch.server.config.LuceneServerConfiguration)1 LocalStateBackend (com.yelp.nrtsearch.server.luceneserver.state.backend.LocalStateBackend)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Test (org.junit.Test)1