You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/06/05 22:17:56 UTC

[03/26] incubator-tinkerpop git commit: added a few pre-processable Gremlin-Hadoop samples. The old samples are still in as a reference.

added a few pre-processable Gremlin-Hadoop samples. The old samples are still in as a reference.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/507495df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/507495df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/507495df

Branch: refs/heads/master
Commit: 507495df7515816984e8579fcf7e12492440f948
Parents: 1faaaf3
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri May 29 17:59:24 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri May 29 17:59:24 2015 +0200

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/507495df/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index eb643e3..633531e 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -571,7 +571,7 @@ gremlin.graph=org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph
 gremlin.hadoop.graphInputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat
 gremlin.hadoop.graphOutputFormat=org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat
 gremlin.hadoop.jarsInDistributedCache=true
-gremlin.hadoop.inputLocation=tinkerpop-modern-vertices.kryo
+gremlin.hadoop.inputLocation=tinkerpop-modern.kryo
 gremlin.hadoop.outputLocation=output
 #####################################
 # GiraphGraphComputer Configuration #
@@ -636,6 +636,17 @@ gremlin> g.V().group().by{it.value('name')[1]}.by('name').next()
 ==>i={ripple=1}
 ==>o={lop=1, josh=1}
 
+[gremlin-groovy]
+----
+hdfs.copyFromLocal('data/tinkerpop-modern.kryo', 'tinkerpop-modern.kryo')
+hdfs.ls()
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(standard())
+g.V().count()
+g.V().out().out().values('name')
+g.V().group().by{it.value('name')[1]}.by('name').next()
+----
+
 OLAP Hadoop-Gremlin
 ~~~~~~~~~~~~~~~~~~~
 
@@ -691,6 +702,14 @@ INFO  org.apache.hadoop.mapred.JobClient  -  map 0% reduce 0%
 ==>ripple
 ==>lop
 
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(computer())
+g.V().count()
+g.V().out().out().values('name')
+----
+
 IMPORTANT: The examples above do not use lambdas (i.e. closures in Gremlin-Groovy). This makes the traversal serializable and thus, able to be distributed to all machines in the Hadoop cluster. If a lambda is required in a traversal, then the traversal must be sent as a `String` and compiled locally at each machine in the cluster. The following example demonstrates the `:remote` command which allows for submitting Gremlin traversals as a `String`.
 
 [source,text]
@@ -736,6 +755,14 @@ gremlin> g.V().out().out().values('name')
 ==>lop
 ==>ripple
 
+[gremlin-groovy]
+----
+graph = GraphFactory.open('conf/hadoop-gryo.properties')
+g = graph.traversal(computer(SparkGraphComputer))
+g.V().count()
+g.V().out().out().values('name')
+----
+
 For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `TraversalSource` which leverages SparkGraphComputer.
 
 [source,test]