-
Notifications
You must be signed in to change notification settings - Fork 58
Command Line Usage
okram edited this page Sep 22, 2012
·
9 revisions
There are three ways to use Gremlin/Faunus:
- Gremlin REPL: the interactive Gremlin shell.
- Gremlin script: submitting a Gremlin traversal as a file.
- Gremlin inline: submitting a Gremlin traversal as an inline parameter.
To start the Gremlin REPL, simply do:
faunus$ bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin>
Assume a file as follows:
g = FaunusFactory.open('bin/faunus.properties')
g.V.out.submit()
Note that FaunusPipeline.submit()
is required to ultimately submit the job to the Hadoop cluster. In the Gremlin REPL, this is handled for the user automatically.
faunus$ bin/gremlin.sh -e test.groovy
12/09/18 15:35:39 INFO mapreduce.FaunusCompiler: Compiled to 1 MapReduce job(s)
12/09/18 15:35:39 INFO mapreduce.FaunusCompiler: Executing job 1 out of 1: MapSequence[com.thinkaurelius.faunus.mapreduce.transform.VerticesMap.Map, com.thinkaurelius.faunus.mapreduce.transform.VerticesVerticesMapReduce.Map, com.thinkaurelius.faunus.mapreduce.transform.VerticesVerticesMapReduce.Reduce]
The arguments are as follows:
- The location of the properties file denoting the
FaunusGraph
. - The Gremlin/Faunus script in quotes.
- A set of overriding property values prefixed with
-D
(optional)- e.g.
-Dfaunus.input.location=agraph mapred.map.tasks=1
- e.g.
faunus$ bin/gremlin.sh -i bin/faunus.properties "g.V.out('battled')"
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: Faunus: Graph Computing with Hadoop
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: ,
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: , |\ ,__
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: |\ \/ `\
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: \ `-.:. `\
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: `-.__ `\/\/\|
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: / `'/ () \
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: .' /\ )
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: .-' .'| \ \__
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: .' __( \ '`(()
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: /_.'` `. | )(
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: \ |
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: |/
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: Generating job chain: g.V.out('battled')
12/09/18 15:26:32 INFO mapreduce.FaunusCompiler: Compiled to 1 MapReduce job(s)