use of com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration in project titan by thinkaurelius.
the class ElasticSearchConfigTest method testLocalNodeUsingExtAndIndexDirectory.
@Test
public void testLocalNodeUsingExtAndIndexDirectory() throws BackendException, InterruptedException {
String baseDir = Joiner.on(File.separator).join("target", "es", "jvmlocal_ext2");
assertFalse(new File(baseDir + File.separator + "data").exists());
CommonsConfiguration cc = new CommonsConfiguration(new BaseConfiguration());
cc.set("index." + INDEX_NAME + ".elasticsearch.ext.node.data", "true");
cc.set("index." + INDEX_NAME + ".elasticsearch.ext.node.client", "false");
cc.set("index." + INDEX_NAME + ".elasticsearch.ext.node.local", "true");
ModifiableConfiguration config = new ModifiableConfiguration(GraphDatabaseConfiguration.ROOT_NS, cc, BasicConfiguration.Restriction.NONE);
config.set(INTERFACE, ElasticSearchSetup.NODE.toString(), INDEX_NAME);
config.set(INDEX_DIRECTORY, baseDir, INDEX_NAME);
Configuration indexConfig = config.restrictTo(INDEX_NAME);
IndexProvider idx = new ElasticSearchIndex(indexConfig);
simpleWriteAndQuery(idx);
idx.close();
assertTrue(new File(baseDir + File.separator + "data").exists());
}
Aggregations