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"));
}
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();
}
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();
}
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();
}
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;
}
Aggregations