Search in sources :

Example 16 with Configuration

use of com.thinkaurelius.titan.diskstorage.configuration.Configuration in project titan by thinkaurelius.

the class ElasticSearchIndexTest method testConfigurationFile.

@Test
public void testConfigurationFile() throws BackendException {
    final String index = "es";
    ModifiableConfiguration config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(LOCAL_MODE, true, index);
    config.set(CLIENT_ONLY, true, index);
    config.set(INDEX_CONF_FILE, Joiner.on(File.separator).join("target", "test-classes", "es_nodename_foo.yml"), index);
    config.set(GraphDatabaseConfiguration.INDEX_DIRECTORY, StorageSetup.getHomeDir("es"), index);
    Configuration indexConfig = config.restrictTo(index);
    // Shouldn't throw exception
    ElasticSearchIndex idx = new ElasticSearchIndex(indexConfig);
    idx.close();
    assertEquals("foo", idx.getNode().settings().get("node.name"));
    config = GraphDatabaseConfiguration.buildGraphConfiguration();
    config.set(LOCAL_MODE, true, index);
    config.set(CLIENT_ONLY, true, index);
    config.set(INDEX_CONF_FILE, Joiner.on(File.separator).join("target", "test-classes", "es_nodename_bar.yml"), index);
    config.set(GraphDatabaseConfiguration.INDEX_DIRECTORY, StorageSetup.getHomeDir("es"), index);
    indexConfig = config.restrictTo(index);
    // Shouldn't throw exception
    idx = new ElasticSearchIndex(indexConfig);
    idx.close();
    assertEquals("bar", idx.getNode().settings().get("node.name"));
}
Also used : Configuration(com.thinkaurelius.titan.diskstorage.configuration.Configuration) GraphDatabaseConfiguration(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) ElasticSearchIndex(com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex) IndexProviderTest(com.thinkaurelius.titan.diskstorage.indexing.IndexProviderTest) Test(org.junit.Test)

Example 17 with Configuration

use of com.thinkaurelius.titan.diskstorage.configuration.Configuration in project titan by thinkaurelius.

the class KeyColumnValueStoreTest method scanTestWithSimpleJob.

@Test
public void scanTestWithSimpleJob() throws Exception {
    int keys = 1000, columns = 40;
    String[][] values = KeyValueStoreUtil.generateData(keys, columns);
    //Make it only half the number of columns for every 2nd key
    for (int i = 0; i < values.length; i++) {
        if (i % 2 == 0)
            values[i] = Arrays.copyOf(values[i], columns / 2);
    }
    log.debug("Loading values: " + keys + "x" + columns);
    loadValues(values);
    clopen();
    StandardScanner scanner = new StandardScanner(manager);
    SimpleScanJobRunner runner = (ScanJob job, Configuration jobConf, String rootNSName) -> runSimpleJob(scanner, job, jobConf);
    SimpleScanJob.runBasicTests(keys, columns, runner);
}
Also used : StandardScanner(com.thinkaurelius.titan.diskstorage.keycolumnvalue.scan.StandardScanner) Configuration(com.thinkaurelius.titan.diskstorage.configuration.Configuration) GraphDatabaseConfiguration(com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration) ScanJob(com.thinkaurelius.titan.diskstorage.keycolumnvalue.scan.ScanJob)

Aggregations

Configuration (com.thinkaurelius.titan.diskstorage.configuration.Configuration)17 GraphDatabaseConfiguration (com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration)14 ModifiableConfiguration (com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)10 Test (org.junit.Test)10 ElasticSearchIndex (com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex)9 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)8 BasicConfiguration (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)7 CommonsConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration)7 PermanentBackendException (com.thinkaurelius.titan.diskstorage.PermanentBackendException)3 StandardStoreFeatures (com.thinkaurelius.titan.diskstorage.keycolumnvalue.StandardStoreFeatures)3 File (java.io.File)3 TitanException (com.thinkaurelius.titan.core.TitanException)2 BackendException (com.thinkaurelius.titan.diskstorage.BackendException)2 TemporaryBackendException (com.thinkaurelius.titan.diskstorage.TemporaryBackendException)2 MergedConfiguration (com.thinkaurelius.titan.diskstorage.configuration.MergedConfiguration)2 IndexProviderTest (com.thinkaurelius.titan.diskstorage.indexing.IndexProviderTest)2 IOException (java.io.IOException)2 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)2 MasterNotRunningException (org.apache.hadoop.hbase.MasterNotRunningException)2 TableNotEnabledException (org.apache.hadoop.hbase.TableNotEnabledException)2