Skip to content

Command Line Usage

okram edited this page Sep 22, 2012 · 9 revisions

There are three ways to use Gremlin/Faunus:

  1. Gremlin REPL: the interactive Gremlin shell.
  2. Gremlin script: submitting a Gremlin traversal as a file.
  3. Gremlin inline: submitting a Gremlin traversal as an inline parameter.

Gremlin REPL

To start the Gremlin REPL, simply do:

faunus$ bin/gremlin.sh 

         \,,,/
         (o o)
-----oOOo-(_)-oOOo-----
gremlin> 

Gremlin Script

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]

Gremlin Inline

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
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)
Clone this wiki locally