You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/02/11 20:45:14 UTC

[08/15] incubator-tinkerpop git commit: updated AsciiDoc reference manual to use new TraversalSource model. Deprecated Order.valueIncr/etc. -- was a simple dangling ticket for 3.2.0.

updated AsciiDoc reference manual to use new TraversalSource model. Deprecated Order.valueIncr/etc. -- was a simple dangling ticket for 3.2.0.


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

Branch: refs/heads/master
Commit: 9e85ac400c15da2f85425579b1e86cf1d34fbbfe
Parents: 2db6faa
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Feb 9 08:49:15 2016 -0700
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Feb 9 08:49:15 2016 -0700

----------------------------------------------------------------------
 .../src/reference/gremlin-applications.asciidoc |  2 +-
 docs/src/reference/implementations.asciidoc     |  8 +++---
 docs/src/reference/intro.asciidoc               |  2 +-
 docs/src/reference/the-graph.asciidoc           |  4 +--
 docs/src/reference/the-graphcomputer.asciidoc   | 12 ++++-----
 docs/src/reference/the-traversal.asciidoc       | 26 ++++++++++----------
 .../gremlin/process/traversal/Order.java        | 24 +++++++++---------
 7 files changed, 39 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 097312e..2c1a6c6 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -123,7 +123,7 @@ The "toy" graph provides a way to get started with Gremlin quickly.
 
 [gremlin-groovy]
 ----
-g = TinkerFactory.createModern().traversal(standard())
+g = TinkerFactory.createModern().traversal()
 g.V()
 g.V().values('name')
 g.V().has('name','marko').out('knows').values('name')

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/implementations.asciidoc b/docs/src/reference/implementations.asciidoc
index 439123d..3b72158 100644
--- a/docs/src/reference/implementations.asciidoc
+++ b/docs/src/reference/implementations.asciidoc
@@ -1183,7 +1183,7 @@ Once the `lib/` directory is distributed, `SparkGraphComputer` can be used as fo
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(SparkGraphComputer))
+g = graph.traversal().withComputer(SparkGraphComputer)
 g.V().count()
 g.V().out().out().values('name')
 ----
@@ -1193,7 +1193,7 @@ For using lambdas in Gremlin-Groovy, simply provide `:remote connect` a `Travers
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(SparkGraphComputer))
+g = graph.traversal().withComputer(SparkGraphComputer)
 :remote connect tinkerpop.hadoop graph g
 :> g.V().group().by{it.value('name')[1]}.by('name')
 ----
@@ -1376,7 +1376,7 @@ System.setProperty('HADOOP_GREMLIN_LIBS',System.getProperty('HADOOP_GREMLIN_LIBS
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(GiraphGraphComputer))
+g = graph.traversal().withComputer(GiraphGraphComputer)
 g.V().count()
 g.V().out().out().values('name')
 ----
@@ -1389,7 +1389,7 @@ following example demonstrates the `:remote` command which allows for submitting
 [gremlin-groovy]
 ----
 graph = GraphFactory.open('conf/hadoop/hadoop-gryo.properties')
-g = graph.traversal(computer(GiraphGraphComputer))
+g = graph.traversal().withComputer(GiraphGraphComputer)
 :remote connect tinkerpop.hadoop graph g
 :> g.V().group().by{it.value('name')[1]}.by('name')
 result

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/intro.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/intro.asciidoc b/docs/src/reference/intro.asciidoc
index 8fb82e3..c3c2305 100644
--- a/docs/src/reference/intro.asciidoc
+++ b/docs/src/reference/intro.asciidoc
@@ -274,7 +274,7 @@ $ bin/gremlin.sh
 -----oOOo-(3)-oOOo-----
 gremlin> graph = TinkerFactory.createModern() // <1>
 ==>tinkergraph[vertices:6 edges:6]
-gremlin> g = graph.traversal(standard())        // <2>
+gremlin> g = graph.traversal()        // <2>
 ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
 gremlin> g.V().has('name','marko').out('knows').values('name') // <3>
 ==>vadas

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/the-graph.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graph.asciidoc b/docs/src/reference/the-graph.asciidoc
index bc914b5..3eab8a0 100644
--- a/docs/src/reference/the-graph.asciidoc
+++ b/docs/src/reference/the-graph.asciidoc
@@ -81,7 +81,7 @@ A running example using vertex properties is provided below to demonstrate and e
 [gremlin-groovy]
 ----
 graph = TinkerGraph.open()
-g = graph.traversal(standard())
+g = graph.traversal()
 v = g.addV('name','marko','name','marko a. rodriguez').next()
 g.V(v).properties('name').count() <1>
 v.property(list, 'name', 'm. a. rodriguez') <2>
@@ -740,7 +740,7 @@ gremlin> r = LegacyGraphSONReader.build().create()
 ==>org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader@64337702
 gremlin> r.readGraph(new FileInputStream('/tmp/tp2.json'), graph)
 ==>null
-gremlin> g = graph.traversal(standard())
+gremlin> g = graph.traversal()
 ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
 gremlin> g.E()
 ==>e[11][4-created->3]

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/the-graphcomputer.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-graphcomputer.asciidoc b/docs/src/reference/the-graphcomputer.asciidoc
index f9116fb..2942a72 100644
--- a/docs/src/reference/the-graphcomputer.asciidoc
+++ b/docs/src/reference/the-graphcomputer.asciidoc
@@ -82,7 +82,7 @@ memory manipulations).
 ----
 result = graph.compute().program(PageRankVertexProgram.build().create()).submit().get()
 result.memory().runtime
-g = result.graph().traversal(standard())
+g = result.graph().traversal()
 g.V().valueMap('name',PageRankVertexProgram.PAGE_RANK)
 ----
 
@@ -140,7 +140,7 @@ that the property is "hidden" unless it is directly accessed via name.
 graph = TinkerFactory.createModern()
 result = graph.compute().program(PeerPressureVertexProgram.build().create()).mapReduce(ClusterPopulationMapReduce.build().create()).submit().get()
 result.memory().get('clusterPopulation')
-g = result.graph().traversal(standard())
+g = result.graph().traversal()
 g.V().values(PeerPressureVertexProgram.CLUSTER).groupCount().next()
 g.V().valueMap()
 ----
@@ -300,7 +300,7 @@ The above `PageRankVertexProgram` is used as follows.
 ----
 result = graph.compute().program(PageRankVertexProgram.build().create()).submit().get()
 result.memory().runtime
-g = result.graph().traversal(standard())
+g = result.graph().traversal()
 g.V().valueMap('name',PageRankVertexProgram.PAGE_RANK)
 ----
 
@@ -388,7 +388,7 @@ TraversalVertexProgram
 ~~~~~~~~~~~~~~~~~~~~~~
 
 image:traversal-vertex-program.png[width=250,float=left] The `TraversalVertexProgram` is a "special" VertexProgram in
-that it can be executed via a `GraphTraversal` with a `ComputerTraversalEngine`. In Gremlin, it is possible to have
+that it can be executed via a `Traversal` and a `GraphComputer`. In Gremlin, it is possible to have
 the same traversal executed using either the standard OTLP-engine or the `GraphComputer` OLAP-engine. The difference
 being where the traversal is submitted.
 
@@ -398,9 +398,9 @@ link:http://markorodriguez.com/2011/04/19/local-and-distributed-traversal-engine
 
 [gremlin-groovy,modern]
 ----
-g = graph.traversal(standard())
+g = graph.traversal()
 g.V().both().hasLabel('person').values('age').groupCount().next() // OLTP
-g = graph.traversal(computer())
+g = graph.traversal().withComputer()
 g.V().both().hasLabel('person').values('age').groupCount().next() // OLAP
 ----
 

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 3f6b4e9..5aebdda 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -328,7 +328,7 @@ made more salient on a larger graph. Therefore, the example below leverages the
 ----
 graph = TinkerGraph.open()
 graph.io(graphml()).readGraph('data/grateful-dead.xml')
-g = graph.traversal(standard())
+g = graph.traversal()
 clockWithResult(1){g.V().both().both().both().count().next()} <1>
 clockWithResult(1){g.V().repeat(both()).times(3).count().next()} <2>
 clockWithResult(1){g.V().both().barrier().both().barrier().both().barrier().count().next()} <3>
@@ -349,7 +349,7 @@ The non-default `LazyBarrierStrategy` inserts `barrier()`-steps in a traversal w
 ----
 graph = TinkerGraph.open()
 graph.io(graphml()).readGraph('data/grateful-dead.xml')
-g = graph.traversal(GraphTraversalSource.build().with(LazyBarrierStrategy.instance()).engine(StandardTraversalEngine.build()))
+g = graph.traversal().withStrategies(LazyBarrierStrategy.instance())
 clockWithResult(1){g.V().both().both().both().count().next()}
 g.V().both().both().both().count().iterate().toString()  <1>
 ----
@@ -923,7 +923,7 @@ songs which Jerry Garcia has both sung and written (using the Grateful Dead grap
 [gremlin-groovy]
 ----
 graph.io(graphml()).readGraph('data/grateful-dead.xml')
-g = graph.traversal(standard())
+g = graph.traversal()
 g.V().match(
         __.as('a').has('name', 'Garcia'),
         __.as('a').in('writtenBy').as('b'),
@@ -1693,7 +1693,7 @@ The following example demonstrates how to produce the "knows" subgraph:
 [gremlin-groovy,modern]
 ----
 subGraph = g.E().hasLabel('knows').subgraph('subGraph').cap('subGraph').next() <1>
-sg = subGraph.traversal(standard())
+sg = subGraph.traversal()
 sg.E() <2>
 ----
 
@@ -1705,7 +1705,7 @@ A more common subgraphing use case is to get all of the graph structure surround
 [gremlin-groovy,modern]
 ----
 subGraph = g.V(3).repeat(__.inE().subgraph('subGraph').outV()).times(3).cap('subGraph').next()  <1>
-sg = subGraph.traversal(standard())
+sg = subGraph.traversal()
 sg.E()
 ----
 
@@ -1718,8 +1718,8 @@ There can be multiple `subgraph()` calls within the same traversal. Each operati
 ----
 t = g.V().outE('knows').subgraph('knowsG').inV().outE('created').subgraph('createdG').
           inV().inE('created').subgraph('createdG').iterate()
-t.sideEffects.get('knowsG').get().traversal(standard()).E()
-t.sideEffects.get('createdG').get().traversal(standard()).E()
+t.sideEffects.get('knowsG').get().traversal().E()
+t.sideEffects.get('createdG').get().traversal().E()
 ----
 
 IMPORTANT: The `subgraph()`-step only writes to graphs that support user supplied ids for its elements. Moreover,
@@ -2208,7 +2208,7 @@ public final class TinkerGraphStepStrategy extends AbstractTraversalStrategy<Tra
 
     @Override
     public void apply(final Traversal.Admin<?, ?> traversal) {
-        if (traversal.getEngine().isComputer())
+        if (traversal.getSideEffects().onGraphComputer())
             return;
 
         TraversalHelper.getStepsOfClass(GraphStep.class, traversal).forEach(originalGraphStep -> {
@@ -2278,7 +2278,7 @@ under the hood.
 ----
 graph = Neo4jGraph.open('/tmp/neo4j')
 strategy = ElementIdStrategy.build().create()
-g = GraphTraversalSource.build().with(strategy).create(graph)
+g = graph.traversal().withStrategies(strategy)
 g.addV().property(id, '42a').id()
 ----
 
@@ -2313,7 +2313,7 @@ console session displays the basic usage:
 graph = TinkerFactory.createModern()
 l = new ConsoleMutationListener(graph)
 strategy = EventStrategy.build().addListener(l).create()
-g = GraphTraversalSource.build().with(strategy).create(graph)
+g = graph.traversal().withStrategies(strategy)
 g.addV('name','stephen')
 g.E().drop()
 ----
@@ -2351,9 +2351,9 @@ The best way to understand `PartitionStrategy` is via example.
 graph = TinkerFactory.createModern()
 strategyA = PartitionStrategy.build().partitionKey("_partition").writePartition("a").addReadPartition("a").create()
 strategyB = PartitionStrategy.build().partitionKey("_partition").writePartition("b").addReadPartition("b").create()
-gA = GraphTraversalSource.build().with(strategyA).create(graph)
+gA = graph.traversal().withStrategies(strategyA)
 gA.addV() // this vertex has a property of {_partition:"a"}
-gB = GraphTraversalSource.build().with(strategyB).create(graph)
+gB = graph.traversal().withStrategies(strategyB)
 gB.addV() // this vertex has a property of {_partition:"b"}
 gA.V()
 gB.V()
@@ -2385,7 +2385,7 @@ and edges as determined by a `Traversal` criterion defined individually for each
 ----
 graph = TinkerFactory.createModern()
 strategy = SubgraphStrategy.build().edgeCriterion(hasId(8,9,10)).create()
-g = GraphTraversalSource.build().with(strategy).create(graph)
+g = graph.traversal().withStrategies(strategy)
 g.V() // shows all vertices as no filter for vertices was specified
 g.E() // shows only the edges defined in the edgeCriterion
 ----

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9e85ac40/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
index 72fe715..4e3801a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
@@ -48,10 +48,10 @@ public enum Order implements Comparator<Object> {
             return incr;
         }
     },
-    /*
+    /**
      * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
-       @Deprecated
-    */
+     */
+    @Deprecated
     keyIncr {
         @Override
         public int compare(final Object first, final Object second) {
@@ -63,10 +63,10 @@ public enum Order implements Comparator<Object> {
             return keyDecr;
         }
     },
-    /*
+    /**
      * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
-     *
-    @Deprecated */
+     */
+    @Deprecated
     valueIncr {
         @Override
         public int compare(final Object first, final Object second) {
@@ -78,10 +78,10 @@ public enum Order implements Comparator<Object> {
             return valueDecr;
         }
     },
-    /*
+    /**
      * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
-     *
-    @Deprecated */
+     */
+    @Deprecated
     keyDecr {
         @Override
         public int compare(final Object first, final Object second) {
@@ -93,10 +93,10 @@ public enum Order implements Comparator<Object> {
             return keyIncr;
         }
     },
-    /*
+    /**
      * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
-     *
-    @Deprecated */
+     */
+    @Deprecated
     valueDecr {
         @Override
         public int compare(final Object first, final Object second) {