You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by mp...@apache.org on 2017/04/09 04:50:38 UTC

[1/3] tinkerpop git commit: provide examples where merge operator actually has an impact

Repository: tinkerpop
Updated Branches:
  refs/heads/master 3f86d21ed -> 4b9c283c2


provide examples where merge operator actually has an impact

see https://groups.google.com/d/msgid/gremlin-users/CD3873E8-F202-4717-92E4-700D6CA80603%40gmail.com


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

Branch: refs/heads/master
Commit: 4c9c6be2fe2709c34d13f7f116b061ea5105b6bc
Parents: 664cd5a
Author: Michael Pollmeier <mi...@michaelpollmeier.com>
Authored: Wed Mar 29 10:39:41 2017 +1300
Committer: Michael Pollmeier <mi...@michaelpollmeier.com>
Committed: Sun Apr 9 16:36:33 2017 +1200

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 33 +++++++++++++++-----------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4c9c6be2/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 32ddcc6..2612309 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -1880,20 +1880,25 @@ merge, their respective sacks are added together.
 
 [gremlin-groovy,modern]
 ----
-g.withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()) <1>
-g.withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).sack() <2>
-g.withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows') <3>
-g.withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').sack() <4>
-g.withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack() <5>
-g.withBulk(false).withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack() <6>
-----
-
-<1> The knows-adjacent vertices of vertex 1 are vertices 2 and 4.
-<2> The `local(...barrier(normSack)...)` ensures that all traversers leaving vertex 1 have an evenly distributed amount of the initial 1.0 "energy" (50-50).
-<3> Going from vertices 2 and 4 yield two traversers at vertex 1.
-<4> Those two traversers each have a sack of 0.5.
-<5> The `barrier()` merges the two traversers at vertex 1 into a single traverser whose sack is 1.0.
-<6> There is now a single traverser with bulk of 2 and sack of 1.0 and thus, setting `withBulk(false)` yields the expected 1.0.
+g.withSack(1.0d).V(1).out('knows').in('knows') <1>
+g.withSack(1.0d).V(1).out('knows').in('knows').sack() <2>
+g.withSack(1.0d, sum).V(1).out('knows').in('knows').sack() <3>
+g.withSack(1.0d).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier() <4>
+g.withSack(1.0d).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack() <5>
+g.withSack(1.0d,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack() <6>
+g.withBulk(false).withSack(1.0f,sum).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack() <7>
+g.withBulk(false).withSack(1.0f).V(1).local(outE('knows').barrier(normSack).inV()).in('knows').barrier().sack()<8>
+
+----
+
+<1> We find vertex 1 twice because he knows two other people
+<2> Without a merge operation the sack values are 1.0.
+<3> When specifying `sum` as the merge operation, the sack values are 2.0 because of bulking
+<4> Like 1, but using barrier internally
+<5> The `local(...barrier(normSack)...)` ensures that all traversers leaving vertex 1 have an evenly distributed amount of the initial 1.0 "energy" (50-50), i.e. the sack is 0.5 on each result
+<6> Like 3, but using `sum` as merge operator leads to the expected 1.0
+<7> There is now a single traverser with bulk of 2 and sack of 1.0 and thus, setting withBulk(false) yields the expected 1.0
+<8> Like 7, but without the sum operator
 
 
 [[sample-step]]


[3/3] tinkerpop git commit: Merge branch 'tp32'

Posted by mp...@apache.org.
Merge branch 'tp32'


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

Branch: refs/heads/master
Commit: 4b9c283c2857f7d27a380be480a8c55479ae02be
Parents: 3f86d21 014575a
Author: Michael Pollmeier <mi...@michaelpollmeier.com>
Authored: Sun Apr 9 16:39:02 2017 +1200
Committer: Michael Pollmeier <mi...@michaelpollmeier.com>
Committed: Sun Apr 9 16:39:02 2017 +1200

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 33 +++++++++++++++-----------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4b9c283c/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------


[2/3] tinkerpop git commit: Merge branch 'sack-doc-update' into tp32

Posted by mp...@apache.org.
Merge branch 'sack-doc-update' into tp32


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

Branch: refs/heads/master
Commit: 014575a00dfdebbe5a3634a5a349f81539adfe24
Parents: 664cd5a 4c9c6be
Author: Michael Pollmeier <mi...@michaelpollmeier.com>
Authored: Sun Apr 9 16:38:45 2017 +1200
Committer: Michael Pollmeier <mi...@michaelpollmeier.com>
Committed: Sun Apr 9 16:38:45 2017 +1200

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc | 33 +++++++++++++++-----------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------