Search in sources :

Example 46 with ModifiableConfiguration

use of com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration 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 47 with ModifiableConfiguration

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

the class MapReduceIndexJobs method cassandraRepair.

public static ScanMetrics cassandraRepair(Properties titanProperties, String indexName, String relationType, String partitionerName, Configuration hadoopBaseConf) throws InterruptedException, IOException, ClassNotFoundException {
    IndexRepairJob job = new IndexRepairJob();
    CassandraHadoopScanRunner cr = new CassandraHadoopScanRunner(job);
    ModifiableConfiguration mc = getIndexJobConf(indexName, relationType);
    copyPropertiesToInputAndOutputConf(hadoopBaseConf, titanProperties);
    cr.partitionerOverride(partitionerName);
    cr.scanJobConf(mc);
    cr.scanJobConfRoot(GraphDatabaseConfiguration.class.getName() + "#JOB_NS");
    cr.baseHadoopConf(hadoopBaseConf);
    return cr.run();
}
Also used : IndexRepairJob(com.thinkaurelius.titan.graphdb.olap.job.IndexRepairJob) CassandraHadoopScanRunner(com.thinkaurelius.titan.hadoop.scan.CassandraHadoopScanRunner) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Example 48 with ModifiableConfiguration

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

the class MapReduceIndexJobs method cassandraRemove.

public static ScanMetrics cassandraRemove(Properties titanProperties, String indexName, String relationType, String partitionerName, Configuration hadoopBaseConf) throws InterruptedException, IOException, ClassNotFoundException {
    IndexRemoveJob job = new IndexRemoveJob();
    CassandraHadoopScanRunner cr = new CassandraHadoopScanRunner(job);
    ModifiableConfiguration mc = getIndexJobConf(indexName, relationType);
    copyPropertiesToInputAndOutputConf(hadoopBaseConf, titanProperties);
    cr.partitionerOverride(partitionerName);
    cr.scanJobConf(mc);
    cr.scanJobConfRoot(GraphDatabaseConfiguration.class.getName() + "#JOB_NS");
    cr.baseHadoopConf(hadoopBaseConf);
    return cr.run();
}
Also used : CassandraHadoopScanRunner(com.thinkaurelius.titan.hadoop.scan.CassandraHadoopScanRunner) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) IndexRemoveJob(com.thinkaurelius.titan.graphdb.olap.job.IndexRemoveJob)

Example 49 with ModifiableConfiguration

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

the class MapReduceIndexJobs method hbaseRemove.

public static ScanMetrics hbaseRemove(Properties titanProperties, String indexName, String relationType, Configuration hadoopBaseConf) throws InterruptedException, IOException, ClassNotFoundException {
    IndexRemoveJob job = new IndexRemoveJob();
    HBaseHadoopScanRunner cr = new HBaseHadoopScanRunner(job);
    ModifiableConfiguration mc = getIndexJobConf(indexName, relationType);
    copyPropertiesToInputAndOutputConf(hadoopBaseConf, titanProperties);
    cr.scanJobConf(mc);
    cr.scanJobConfRoot(GraphDatabaseConfiguration.class.getName() + "#JOB_NS");
    cr.baseHadoopConf(hadoopBaseConf);
    return cr.run();
}
Also used : HBaseHadoopScanRunner(com.thinkaurelius.titan.hadoop.scan.HBaseHadoopScanRunner) ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration) IndexRemoveJob(com.thinkaurelius.titan.graphdb.olap.job.IndexRemoveJob)

Example 50 with ModifiableConfiguration

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

the class CassandraStorageSetup method getEmbeddedCassandraPartitionConfiguration.

public static ModifiableConfiguration getEmbeddedCassandraPartitionConfiguration(String ks) {
    ModifiableConfiguration config = getEmbeddedConfiguration(ks);
    config.set(IDS_FLUSH, false);
    return config;
}
Also used : ModifiableConfiguration(com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)

Aggregations

ModifiableConfiguration (com.thinkaurelius.titan.diskstorage.configuration.ModifiableConfiguration)55 Test (org.junit.Test)13 Configuration (com.thinkaurelius.titan.diskstorage.configuration.Configuration)9 ElasticSearchIndex (com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex)9 GraphDatabaseConfiguration (com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration)9 CommonsConfiguration (com.thinkaurelius.titan.diskstorage.configuration.backend.CommonsConfiguration)8 BaseConfiguration (org.apache.commons.configuration.BaseConfiguration)8 BasicConfiguration (com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration)7 File (java.io.File)3 KeyColumnValueStoreTest (com.thinkaurelius.titan.diskstorage.KeyColumnValueStoreTest)2 WriteConfiguration (com.thinkaurelius.titan.diskstorage.configuration.WriteConfiguration)2 IndexProviderTest (com.thinkaurelius.titan.diskstorage.indexing.IndexProviderTest)2 InMemoryStoreManager (com.thinkaurelius.titan.diskstorage.keycolumnvalue.inmemory.InMemoryStoreManager)2 StandardBaseTransactionConfig (com.thinkaurelius.titan.diskstorage.util.StandardBaseTransactionConfig)2 IndexRemoveJob (com.thinkaurelius.titan.graphdb.olap.job.IndexRemoveJob)2 IndexRepairJob (com.thinkaurelius.titan.graphdb.olap.job.IndexRepairJob)2 CassandraHadoopScanRunner (com.thinkaurelius.titan.hadoop.scan.CassandraHadoopScanRunner)2 HBaseHadoopScanRunner (com.thinkaurelius.titan.hadoop.scan.HBaseHadoopScanRunner)2 Map (java.util.Map)2 TitanFactory (com.thinkaurelius.titan.core.TitanFactory)1