[3/3] tinkerpop git commit: Merge branch 'tp32'
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/6e78d5a2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6e78d5a2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6e78d5a2 Branch: refs/heads/master Commit: 6e78d5a2b3d625c54ef212fc55830a364b044321 Parents: fd6adce fd6f6b4 Author: Michael PollmeierAuthored: Tue Nov 14 14:25:19 2017 +1300 Committer: Michael Pollmeier Committed: Tue Nov 14 14:25:19 2017 +1300 -- CHANGELOG.asciidoc | 1 + .../gremlin/tinkergraph/structure/TinkerIndex.java | 11 +-- 2 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e78d5a2/CHANGELOG.asciidoc --
[2/3] tinkerpop git commit: Merge branch 'mp/1830-tinkergraph-index-race-condition' into tp32
Merge branch 'mp/1830-tinkergraph-index-race-condition' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fd6f6b4c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fd6f6b4c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fd6f6b4c Branch: refs/heads/master Commit: fd6f6b4c21894ae527c0602db14be696ebd8a619 Parents: ac99e3c 7be8a0f Author: Michael Pollmeier <mich...@michaelpollmeier.com> Authored: Tue Nov 14 14:23:47 2017 +1300 Committer: Michael Pollmeier <mich...@michaelpollmeier.com> Committed: Tue Nov 14 14:23:47 2017 +1300 -- CHANGELOG.asciidoc | 1 + .../gremlin/tinkergraph/structure/TinkerIndex.java | 11 +-- 2 files changed, 6 insertions(+), 6 deletions(-) --
[2/2] tinkerpop git commit: Merge branch 'mp/1830-tinkergraph-index-race-condition' into tp32
Merge branch 'mp/1830-tinkergraph-index-race-condition' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fd6f6b4c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fd6f6b4c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fd6f6b4c Branch: refs/heads/tp32 Commit: fd6f6b4c21894ae527c0602db14be696ebd8a619 Parents: ac99e3c 7be8a0f Author: Michael Pollmeier <mich...@michaelpollmeier.com> Authored: Tue Nov 14 14:23:47 2017 +1300 Committer: Michael Pollmeier <mich...@michaelpollmeier.com> Committed: Tue Nov 14 14:23:47 2017 +1300 -- CHANGELOG.asciidoc | 1 + .../gremlin/tinkergraph/structure/TinkerIndex.java | 11 +-- 2 files changed, 6 insertions(+), 6 deletions(-) --
[1/2] tinkerpop git commit: fix race condition in TinkerIndex
Repository: tinkerpop Updated Branches: refs/heads/tp32 ac99e3cf2 -> fd6f6b4c2 fix race condition in TinkerIndex My colleage @fabsx00 discovered a race condition in tinkergraph's index creation. He fixed it by simply replacing parallelStream with stream. Quoting his analysis: So, reading the code, you see that this.put is called in parallel, but that method seems to contain a race as get is called on the index, checked for null, and a subsequent write is performed. It still seems like using stream here fixes the problem we've been seeing, and the performance hit is not significant. Ticket: https://issues.apache.org/jira/browse/TINKERPOP-1830 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7be8a0f2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7be8a0f2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7be8a0f2 Branch: refs/heads/tp32 Commit: 7be8a0f25672e20fb0fef58075c2a201501f0578 Parents: ac99e3c Author: Michael PollmeierAuthored: Sun Nov 12 12:32:37 2017 +1300 Committer: Michael Pollmeier Committed: Tue Nov 14 14:22:40 2017 +1300 -- CHANGELOG.asciidoc | 1 + .../gremlin/tinkergraph/structure/TinkerIndex.java | 11 +-- 2 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7be8a0f2/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index ffd9de5..cd5dc38 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-2-7]] === TinkerPop 3.2.7 (Release Date: NOT OFFICIALLY RELEASED YET) +* Fixed a race condition in `TinkerIndex`. * Fixed an `ArrayOutOfBoundsException` in `hasId()` for the rare situation when the provided collection is empty. * Bump to Netty 4.0.52 * `TraversalVertexProgram` `profile()` now accounts for worker iteration in `GraphComputer` OLAP. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7be8a0f2/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIndex.java -- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIndex.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIndex.java index 69afb39..f5872cf 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIndex.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIndex.java @@ -48,17 +48,16 @@ final class TinkerIndex { protected void put(final String key, final Object value, final T element) { Map
[1/7] tinkerpop git commit: move implementation of clone to GraphHelper
Repository: tinkerpop Updated Branches: refs/heads/master fc48b046c -> c60cb9e74 move implementation of clone to GraphHelper Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9bf5f636 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9bf5f636 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9bf5f636 Branch: refs/heads/master Commit: 9bf5f636eb46f2ae3a8869b3373134ffd94ebb70 Parents: a44e881 Author: Michael PollmeierAuthored: Mon Sep 11 10:53:40 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:27 2017 +1200 -- gremlin-core/pom.xml| 6 ++ .../gremlin/structure/util/GraphHelper.java | 39 + .../gremlin/structure/util/GraphHelperTest.java | 59 .../tinkergraph/structure/TinkerGraph.java | 17 +- .../tinkergraph/structure/TinkerGraphTest.java | 30 -- 5 files changed, 105 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/pom.xml -- diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml index bab7b65..e690c5d 100644 --- a/gremlin-core/pom.xml +++ b/gremlin-core/pom.xml @@ -95,6 +95,12 @@ limitations under the License. hamcrest-all test + +org.apache.tinkerpop +tinkergraph-gremlin +${project.version} +test + commons-collections http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java new file mode 100644 index 000..5d4809c --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.structure.util; + +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; + +/** + * Utility class supporting common functions for {@link org.apache.tinkerpop.gremlin.structure.Graph}. + */ +public final class GraphHelper { + + private GraphHelper() { + } + + /** + * make a deep clone of the graph elements that preserves ids + */ + public static void cloneElements(final Graph original, final Graph clone) { +original.vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(clone))); +original.edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(clone))); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java new file mode 100644 index 000..c186caf --- /dev/null +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the
[6/7] tinkerpop git commit: Merge branch 'mp/tinkergraph-clone' into tp32
Merge branch 'mp/tinkergraph-clone' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/615026ce Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/615026ce Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/615026ce Branch: refs/heads/master Commit: 615026cef35f1ae76bb999bdcd6f6faeab2020df Parents: 132011f 67db5e8 Author: Michael Pollmeier <mich...@michaelpollmeier.com> Authored: Thu Sep 21 14:13:26 2017 +1200 Committer: Michael Pollmeier <mich...@michaelpollmeier.com> Committed: Thu Sep 21 14:13:26 2017 +1200 -- CHANGELOG.asciidoc | 1 + .../upgrade/release-3.2.x-incubating.asciidoc | 4 ++ .../apache/tinkerpop/gremlin/GraphHelper.java | 40 .../tinkergraph/structure/TinkerGraphTest.java | 32 4 files changed, 77 insertions(+) --
[3/7] tinkerpop git commit: resolve cyclic dependency by moving GraphHelper to gremlin-test
resolve cyclic dependency by moving GraphHelper to gremlin-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3d0cd1a9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3d0cd1a9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3d0cd1a9 Branch: refs/heads/master Commit: 3d0cd1a959b37ff3a829138859558ce1bcc90191 Parents: f6d0a2c Author: Michael PollmeierAuthored: Mon Sep 18 16:38:48 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:55 2017 +1200 -- gremlin-core/pom.xml| 6 -- .../gremlin/structure/util/GraphHelper.java | 39 - .../gremlin/structure/util/GraphHelperTest.java | 59 .../apache/tinkerpop/gremlin/GraphHelper.java | 40 + .../tinkergraph/structure/TinkerGraphTest.java | 32 +++ 5 files changed, 72 insertions(+), 104 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/pom.xml -- diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml index e690c5d..bab7b65 100644 --- a/gremlin-core/pom.xml +++ b/gremlin-core/pom.xml @@ -95,12 +95,6 @@ limitations under the License. hamcrest-all test - -org.apache.tinkerpop -tinkergraph-gremlin -${project.version} -test - commons-collections http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java deleted file mode 100644 index 5d4809c..000 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.structure.util; - -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; - -/** - * Utility class supporting common functions for {@link org.apache.tinkerpop.gremlin.structure.Graph}. - */ -public final class GraphHelper { - - private GraphHelper() { - } - - /** - * make a deep clone of the graph elements that preserves ids - */ - public static void cloneElements(final Graph original, final Graph clone) { -original.vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(clone))); -original.edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(clone))); - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java deleted file mode 100644 index c186caf..000 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * -
[5/7] tinkerpop git commit: minor fixes to changelog
minor fixes to changelog Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/67db5e8e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/67db5e8e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/67db5e8e Branch: refs/heads/master Commit: 67db5e8eb54265b2f379c7aade7c44d3b5ed009b Parents: 3d0cd1a Author: Michael PollmeierAuthored: Thu Sep 21 14:06:23 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:09:22 2017 +1200 -- docs/src/upgrade/release-3.2.x-incubating.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67db5e8e/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index 9b576f9..96017b4 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -90,8 +90,7 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1764[TINKERPOP-1764] Clone a graph ^ -If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)`. - +If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)` which is part of the gremlin-test module. TinkerPop 3.2.6 ---
[7/7] tinkerpop git commit: Merge branch 'tp32'
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/c60cb9e7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c60cb9e7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c60cb9e7 Branch: refs/heads/master Commit: c60cb9e7493c2285e5d85215f849638bda2460b9 Parents: fc48b04 615026c Author: Michael PollmeierAuthored: Thu Sep 21 14:15:19 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:15:19 2017 +1200 -- CHANGELOG.asciidoc | 1 + .../upgrade/release-3.2.x-incubating.asciidoc | 4 ++ .../apache/tinkerpop/gremlin/GraphHelper.java | 40 .../tinkergraph/structure/TinkerGraphTest.java | 32 4 files changed, 77 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c60cb9e7/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c60cb9e7/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c60cb9e7/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java --
[2/7] tinkerpop git commit: make TinkerGraph cloneable
make TinkerGraph cloneable Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a44e8815 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a44e8815 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a44e8815 Branch: refs/heads/master Commit: a44e881533a29231752ed4884d3a87c63bf4befc Parents: 132011f Author: Michael PollmeierAuthored: Mon Sep 4 20:02:26 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:27 2017 +1200 -- .../tinkergraph/structure/TinkerGraph.java | 17 ++- .../tinkergraph/structure/TinkerGraphTest.java | 30 2 files changed, 46 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a44e8815/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java -- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java index 5563665..6501663 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java @@ -30,9 +30,13 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.apache.tinkerpop.gremlin.structure.io.Io; import org.apache.tinkerpop.gremlin.structure.io.IoCore; +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion; +import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion; +import org.apache.tinkerpop.gremlin.structure.util.Attachable; import org.apache.tinkerpop.gremlin.structure.util.ElementHelper; import org.apache.tinkerpop.gremlin.structure.util.GraphFactory; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; +import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputerView; import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.strategy.optimization.TinkerGraphCountStrategy; @@ -70,7 +74,7 @@ import java.util.stream.Stream; @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT) @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE) @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE) -public final class TinkerGraph implements Graph { +public final class TinkerGraph implements Graph, Cloneable { static { TraversalStrategies.GlobalCache.registerStrategies(TinkerGraph.class, TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies( @@ -378,6 +382,17 @@ public final class TinkerGraph implements Graph { } } +/** + * make a deep clone of the graph/vertices/edges that preserves ids + */ +@Override +public TinkerGraph clone() { +final TinkerGraph cloned = new TinkerGraph(configuration); +vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(cloned))); +edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(cloned))); +return cloned; +} + public class TinkerGraphFeatures implements Features { private final TinkerGraphGraphFeatures graphFeatures = new TinkerGraphGraphFeatures(); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a44e8815/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index a85b0ee..cb4f4d7 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -68,6 +68,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; @@ -593,6 +594,35 @@ public class TinkerGraphTest { } } +@Test +
[4/7] tinkerpop git commit: update changelog and upgrade logs
update changelog and upgrade logs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f6d0a2c3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f6d0a2c3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f6d0a2c3 Branch: refs/heads/master Commit: f6d0a2c36a36ea3af44f507bf3340d19fac0da96 Parents: 9bf5f63 Author: Michael PollmeierAuthored: Mon Sep 11 11:00:13 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:55 2017 +1200 -- CHANGELOG.asciidoc | 1 + docs/src/upgrade/release-3.2.x-incubating.asciidoc | 5 + 2 files changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d0a2c3/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 453552a..64d4167 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima TinkerPop 3.2.7 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Added `GraphHelper.cloneElements(Graph original, Graph clone)` to quickly clone a graph. * Bump to GMavenPlus 1.6. * Added better error message for illegal use of `repeat()`-step. * Bump to Jackson 2.8.10. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d0a2c3/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index ae504d4..9b576f9 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -88,6 +88,11 @@ to the list of locally computed clauses. See: link:https://issues.apache.org/jira/browse/TINKERPOP-1764[TINKERPOP-1764] +Clone a graph +^ +If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)`. + + TinkerPop 3.2.6 ---
[2/6] tinkerpop git commit: make TinkerGraph cloneable
make TinkerGraph cloneable Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a44e8815 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a44e8815 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a44e8815 Branch: refs/heads/tp32 Commit: a44e881533a29231752ed4884d3a87c63bf4befc Parents: 132011f Author: Michael PollmeierAuthored: Mon Sep 4 20:02:26 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:27 2017 +1200 -- .../tinkergraph/structure/TinkerGraph.java | 17 ++- .../tinkergraph/structure/TinkerGraphTest.java | 30 2 files changed, 46 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a44e8815/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java -- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java index 5563665..6501663 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java @@ -30,9 +30,13 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.apache.tinkerpop.gremlin.structure.io.Io; import org.apache.tinkerpop.gremlin.structure.io.IoCore; +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion; +import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoVersion; +import org.apache.tinkerpop.gremlin.structure.util.Attachable; import org.apache.tinkerpop.gremlin.structure.util.ElementHelper; import org.apache.tinkerpop.gremlin.structure.util.GraphFactory; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; +import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputerView; import org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.strategy.optimization.TinkerGraphCountStrategy; @@ -70,7 +74,7 @@ import java.util.stream.Stream; @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT) @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE) @Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE) -public final class TinkerGraph implements Graph { +public final class TinkerGraph implements Graph, Cloneable { static { TraversalStrategies.GlobalCache.registerStrategies(TinkerGraph.class, TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies( @@ -378,6 +382,17 @@ public final class TinkerGraph implements Graph { } } +/** + * make a deep clone of the graph/vertices/edges that preserves ids + */ +@Override +public TinkerGraph clone() { +final TinkerGraph cloned = new TinkerGraph(configuration); +vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(cloned))); +edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(cloned))); +return cloned; +} + public class TinkerGraphFeatures implements Features { private final TinkerGraphGraphFeatures graphFeatures = new TinkerGraphGraphFeatures(); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a44e8815/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index a85b0ee..cb4f4d7 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -68,6 +68,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; @@ -593,6 +594,35 @@ public class TinkerGraphTest { } } +@Test +
[5/6] tinkerpop git commit: minor fixes to changelog
minor fixes to changelog Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/67db5e8e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/67db5e8e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/67db5e8e Branch: refs/heads/tp32 Commit: 67db5e8eb54265b2f379c7aade7c44d3b5ed009b Parents: 3d0cd1a Author: Michael PollmeierAuthored: Thu Sep 21 14:06:23 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:09:22 2017 +1200 -- docs/src/upgrade/release-3.2.x-incubating.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/67db5e8e/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index 9b576f9..96017b4 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -90,8 +90,7 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1764[TINKERPOP-1764] Clone a graph ^ -If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)`. - +If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)` which is part of the gremlin-test module. TinkerPop 3.2.6 ---
[1/6] tinkerpop git commit: move implementation of clone to GraphHelper
Repository: tinkerpop Updated Branches: refs/heads/tp32 132011fb5 -> 615026cef move implementation of clone to GraphHelper Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9bf5f636 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9bf5f636 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9bf5f636 Branch: refs/heads/tp32 Commit: 9bf5f636eb46f2ae3a8869b3373134ffd94ebb70 Parents: a44e881 Author: Michael PollmeierAuthored: Mon Sep 11 10:53:40 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:27 2017 +1200 -- gremlin-core/pom.xml| 6 ++ .../gremlin/structure/util/GraphHelper.java | 39 + .../gremlin/structure/util/GraphHelperTest.java | 59 .../tinkergraph/structure/TinkerGraph.java | 17 +- .../tinkergraph/structure/TinkerGraphTest.java | 30 -- 5 files changed, 105 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/pom.xml -- diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml index bab7b65..e690c5d 100644 --- a/gremlin-core/pom.xml +++ b/gremlin-core/pom.xml @@ -95,6 +95,12 @@ limitations under the License. hamcrest-all test + +org.apache.tinkerpop +tinkergraph-gremlin +${project.version} +test + commons-collections http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java new file mode 100644 index 000..5d4809c --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.structure.util; + +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; + +/** + * Utility class supporting common functions for {@link org.apache.tinkerpop.gremlin.structure.Graph}. + */ +public final class GraphHelper { + + private GraphHelper() { + } + + /** + * make a deep clone of the graph elements that preserves ids + */ + public static void cloneElements(final Graph original, final Graph clone) { +original.vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(clone))); +original.edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(clone))); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9bf5f636/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java new file mode 100644 index 000..c186caf --- /dev/null +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License.
[3/6] tinkerpop git commit: resolve cyclic dependency by moving GraphHelper to gremlin-test
resolve cyclic dependency by moving GraphHelper to gremlin-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3d0cd1a9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3d0cd1a9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3d0cd1a9 Branch: refs/heads/tp32 Commit: 3d0cd1a959b37ff3a829138859558ce1bcc90191 Parents: f6d0a2c Author: Michael PollmeierAuthored: Mon Sep 18 16:38:48 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:55 2017 +1200 -- gremlin-core/pom.xml| 6 -- .../gremlin/structure/util/GraphHelper.java | 39 - .../gremlin/structure/util/GraphHelperTest.java | 59 .../apache/tinkerpop/gremlin/GraphHelper.java | 40 + .../tinkergraph/structure/TinkerGraphTest.java | 32 +++ 5 files changed, 72 insertions(+), 104 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/pom.xml -- diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml index e690c5d..bab7b65 100644 --- a/gremlin-core/pom.xml +++ b/gremlin-core/pom.xml @@ -95,12 +95,6 @@ limitations under the License. hamcrest-all test - -org.apache.tinkerpop -tinkergraph-gremlin -${project.version} -test - commons-collections http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java deleted file mode 100644 index 5d4809c..000 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.structure.util; - -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory; - -/** - * Utility class supporting common functions for {@link org.apache.tinkerpop.gremlin.structure.Graph}. - */ -public final class GraphHelper { - - private GraphHelper() { - } - - /** - * make a deep clone of the graph elements that preserves ids - */ - public static void cloneElements(final Graph original, final Graph clone) { -original.vertices().forEachRemaining(v -> DetachedFactory.detach(v, true).attach(Attachable.Method.create(clone))); -original.edges().forEachRemaining(e -> DetachedFactory.detach(e, true).attach(Attachable.Method.create(clone))); - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3d0cd1a9/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java deleted file mode 100644 index c186caf..000 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/util/GraphHelperTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - *
[6/6] tinkerpop git commit: Merge branch 'mp/tinkergraph-clone' into tp32
Merge branch 'mp/tinkergraph-clone' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/615026ce Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/615026ce Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/615026ce Branch: refs/heads/tp32 Commit: 615026cef35f1ae76bb999bdcd6f6faeab2020df Parents: 132011f 67db5e8 Author: Michael Pollmeier <mich...@michaelpollmeier.com> Authored: Thu Sep 21 14:13:26 2017 +1200 Committer: Michael Pollmeier <mich...@michaelpollmeier.com> Committed: Thu Sep 21 14:13:26 2017 +1200 -- CHANGELOG.asciidoc | 1 + .../upgrade/release-3.2.x-incubating.asciidoc | 4 ++ .../apache/tinkerpop/gremlin/GraphHelper.java | 40 .../tinkergraph/structure/TinkerGraphTest.java | 32 4 files changed, 77 insertions(+) --
[4/6] tinkerpop git commit: update changelog and upgrade logs
update changelog and upgrade logs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f6d0a2c3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f6d0a2c3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f6d0a2c3 Branch: refs/heads/tp32 Commit: f6d0a2c36a36ea3af44f507bf3340d19fac0da96 Parents: 9bf5f63 Author: Michael PollmeierAuthored: Mon Sep 11 11:00:13 2017 +1200 Committer: Michael Pollmeier Committed: Thu Sep 21 14:08:55 2017 +1200 -- CHANGELOG.asciidoc | 1 + docs/src/upgrade/release-3.2.x-incubating.asciidoc | 5 + 2 files changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d0a2c3/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 453552a..64d4167 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima TinkerPop 3.2.7 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Added `GraphHelper.cloneElements(Graph original, Graph clone)` to quickly clone a graph. * Bump to GMavenPlus 1.6. * Added better error message for illegal use of `repeat()`-step. * Bump to Jackson 2.8.10. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d0a2c3/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index ae504d4..9b576f9 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -88,6 +88,11 @@ to the list of locally computed clauses. See: link:https://issues.apache.org/jira/browse/TINKERPOP-1764[TINKERPOP-1764] +Clone a graph +^ +If you want to quickly clone a graph (e.g. because you have set it up in a test and your traversals manipulate the graph) you can now use `GraphHelper.cloneElements(Graph original, Graph clone)`. + + TinkerPop 3.2.6 ---
[1/2] tinkerpop git commit: provide examples where merge operator actually has an impact
Repository: tinkerpop Updated Branches: refs/heads/tp32 664cd5a64 -> 014575a00 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/tp32 Commit: 4c9c6be2fe2709c34d13f7f116b061ea5105b6bc Parents: 664cd5a Author: Michael PollmeierAuthored: Wed Mar 29 10:39:41 2017 +1300 Committer: Michael Pollmeier 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]]
[2/2] tinkerpop git commit: Merge branch 'sack-doc-update' into tp32
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/tp32 Commit: 014575a00dfdebbe5a3634a5a349f81539adfe24 Parents: 664cd5a 4c9c6be Author: Michael PollmeierAuthored: Sun Apr 9 16:38:45 2017 +1200 Committer: Michael Pollmeier Committed: Sun Apr 9 16:38:45 2017 +1200 -- docs/src/reference/the-traversal.asciidoc | 33 +++--- 1 file changed, 19 insertions(+), 14 deletions(-) --
[3/3] tinkerpop git commit: Merge branch 'tp32'
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 PollmeierAuthored: Sun Apr 9 16:39:02 2017 +1200 Committer: Michael Pollmeier 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
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 PollmeierAuthored: Sun Apr 9 16:38:45 2017 +1200 Committer: Michael Pollmeier Committed: Sun Apr 9 16:38:45 2017 +1200 -- docs/src/reference/the-traversal.asciidoc | 33 +++--- 1 file changed, 19 insertions(+), 14 deletions(-) --
[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 PollmeierAuthored: Wed Mar 29 10:39:41 2017 +1300 Committer: Michael Pollmeier 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]]