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