Skip to content

Instantly share code, notes, and snippets.

View okram's full-sized avatar
🏠
Working from home

Marko A. Rodriguez okram

🏠
Working from home
View GitHub Profile
faunus$ bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin> g = FaunusFactory.open("bin/faunus-titan.properties")
==>faunusgraph[TitanCassandraInputFormat]
gremlin> g.V
==>com.thinkaurelius.faunus.FaunusPipeline@326cbecf
gremlin> g.V.out('name').groupCount().submit()
faunus$ bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin> g = FaunusFactory.open("bin/faunus-titan.properties")
==>faunusgraph[titancassandrainputformat]
gremlin> g.V.out.name.groupCount.submit()
12/09/11 17:36:09 INFO mapreduce.FaunusCompiler: Faunus: A Library of Hadoop-Based Graph Tools
12/09/11 17:36:09 INFO mapreduce.FaunusCompiler: ,
faunus$ bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin> g = FaunusFactory.open('bin/faunus-titan.properties')
==>faunusgraph[titancassandrainputformat]
gremlin> g.V.out('father').out('father').toString()
==>[VerticesMap, VerticesVerticesMapReduce(OUT,[father]), VerticesVerticesMapReduce(OUT,[father])]
gremlin> g.V.out('father').out('father').drop
faunus$ bin/gremlin.sh -i 'g.E.label.groupCount'
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: Faunus: A Library of Hadoop-Based Graph Tools
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: ,
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: , |\ ,__
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: |\ \/ `\
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: \ `-.:. `\
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: `-.__ `\/\/\|
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: / `'/ () \
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: .' /\ )
12/09/12 11:28:11 INFO mapreduce.FaunusCompiler: .-' .'| \ \__
if [ "$HADOOP_CONF_DIR" != "" ] ; then
CP=$CP:$HADOOP_CONF_DIR
elif [ "$HADOOP_CONF" != "" ] ; then
CP=$CP:$HADOOP_CONF
else
CP=$CP:$HADOOP_HOME/conf
fi
public void testStartupCosts() throws Exception {
final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
CompiledScript script1 = engine.compile("");
CompiledScript script2 = engine.compile("1+1");
int runs = 750;
long totalTime = 0l;
for (int i = 0; i < runs; i++) {
long time = System.currentTimeMillis();
//engine.eval("");
public void testStartupCostsEngineVsCompiled() throws Exception {
final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
Bindings bindings = engine.createBindings();
bindings.put("g", TinkerGraphFactory.createTinkerGraph());
int runs = 500;
long totalTime = 0l;
for (int i = 0; i < runs; i++) {
long time = System.currentTimeMillis();
TransactionalGraph g = new EgoSystemGraph();
AddFollowsExtension af = new AddFollowsExtension();
JSONObject request = new JSONObject('''
{
sourceIdentity: {uri:'http://marko'},
targetIdentities: [{uri:'http://herbert'}],
inOrOut: 'out'
}
''');
assertFalse(af.addFollows(new RexsterResourceContext(null, null, null, request, null, null, null), g).errorResponse);
public void testAddOneAuthor() {
TransactionalGraph g = new EgoSystemGraph();
AddAuthoredExtension aa = new AddAuthoredExtension();
JSONObject request = new JSONObject('''
{
uri:'http://mypaper',
title:'My Paper',
citations:455,
keywords:[{uri:'keyword:blah'},{uri:'keyword:bam'}],
authors: [
Core:
{
person: {uuid:'1234',name:'marko'},
identities : [
{service:'twitter',handle:'@twarko',uri:'http://twitter.com/twarko'},
{service:'lanl',handle:209893, uri:'http://people.lanl.gov/209893'}
]
}