Search in sources :

Example 11 with CommonsConfiguration

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());
}
Also used : BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) Configuration(com.thinkaurelius.titan.diskstorage.configuration.Configuration) CommonsConfiguration(com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration) BasicConfiguration(com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration) GraphDatabaseConfiguration(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration) BaseConfiguration(org.apache.commons.configuration.BaseConfiguration) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) CommonsConfiguration(com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) ElasticSearchIndex(com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex) File(java.io.File) Test(org.junit.Test)

Aggregations

CommonsConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration)11 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)8 Test (org.junit.Test)6 BasicConfiguration (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)5 ModifiableConfiguration (com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)5 GraphDatabaseConfiguration (com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration)5 Configuration (com.thinkaurelius.titan.diskstorage.configuration.Configuration)4 ElasticSearchIndex (com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex)4 File (java.io.File)4 ConfigurationException (org.apache.commons.configuration.ConfigurationException)2 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 TitanGraph (com.thinkaurelius.titan.core.TitanGraph)1 ConfigElement (com.thinkaurelius.titan.diskstorage.configuration.ConfigElement)1 WriteConfiguration (com.thinkaurelius.titan.diskstorage.configuration.WriteConfiguration)1 StandardTitanGraph (com.thinkaurelius.titan.graphdb.database.StandardTitanGraph)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 Duration (java.time.Duration)1 ChronoUnit (java.time.temporal.ChronoUnit)1