Skip to content

Instantly share code, notes, and snippets.

@rkroll
Created April 23, 2013 16:08
Show Gist options
  • Save rkroll/5444957 to your computer and use it in GitHub Desktop.
Save rkroll/5444957 to your computer and use it in GitHub Desktop.
Run a faunus job
final String file = "bin/titan-cassandra-input.properties";
final Properties fileConfiguration = new Properties();
final Properties commandLineConfiguration = new Properties();
fileConfiguration.load(new FileInputStream(file));
final Configuration conf = new Configuration();
for (Map.Entry<Object, Object> entry : fileConfiguration.entrySet()) {
conf.set(entry.getKey().toString(), entry.getValue().toString());
}
for (Map.Entry<Object, Object> entry : commandLineConfiguration.entrySet()) {
conf.set(entry.getKey().toString(), entry.getValue().toString());
}
FaunusGraph g = new FaunusGraph(conf);
FaunusPipeline pipe = new FaunusPipeline(g);
pipe.V().has("idx_country_id", "us")
.out("country_has_state")
.out("state_has_city")
.out("city_has_address")
.count();
FaunusCompiler compiler = pipe.getCompiler();
compiler.completeSequence();
compiler.run(new String[] {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment