[36/45] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fc52939/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyOrderTest { - -public static class Traversals extends OrderTest { - -@Override -public Traversalget_g_V_name_order() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") -} - -@Override -public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") -} - -@Override -public Traversal get_g_V_order_byXname_incrX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") -} - -@Override -public Traversal get_g_V_order_byXnameX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") -} - -@Override -public Traversal get_g_V_outE_order_byXweight_decrX_weight() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") -} - -@Override -public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") -} - -@Override -public Traversal > get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") -} - -@Override -public Traversal > get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { -final Map map = [:]; -map[1] = it.age; -map[2] = it.age * 2; -map[3] = it.age * 3; -map[4] = it.age; -return map; -}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) -} - -@Override -public Traversal get_g_V_order_byXoutE_count__decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") -} - -@Override -public Traversal > get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") -} - -@Override -public Traversal get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") -} - -@Override -public Traversal >
[33/45] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fc52939/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java new file mode 100644 index 000..84542e1 --- /dev/null +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java @@ -0,0 +1,406 @@ +/* + * 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.groovy.jsr223; + +import groovy.lang.MissingPropertyException; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration; +import org.junit.Assert; +import org.junit.Test; + +import javax.script.Bindings; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.concurrent.CountDownLatch; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class GremlinGroovyScriptEngineOverGraphTest { + +@Test +public void shouldDoSomeGremlin() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engine = new GremlinGroovyScriptEngine(); +final List list = new ArrayList(); +final Bindings bindings = engine.createBindings(); +bindings.put("g", g); +bindings.put("marko", convertToVertexId(graph, "marko")); +bindings.put("temp", list); +assertEquals(list.size(), 0); +engine.eval("g.V(marko).out().fill(temp)",bindings); +assertEquals(list.size(), 3); +} + +@Test +public void shouldLoadImports() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engineNoImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); +try { +engineNoImports.eval("Vertex.class.getName()"); +fail("Should have thrown an exception because no imports were supplied"); +} catch (Exception se) { +assertTrue(se instanceof ScriptException); +} + +final ScriptEngine engineWithImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) new DefaultImportCustomizerProvider()); +engineWithImports.put("g", g); +assertEquals(Vertex.class.getName(), engineWithImports.eval("Vertex.class.getName()")); +assertEquals(2l, engineWithImports.eval("g.V().has('age',gt(30)).count().next()")); +assertEquals(Direction.IN,
[05/45] tinkerpop git commit: removed unuseful type check in Int32IO class
removed unuseful type check in Int32IO class Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1267ed04 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1267ed04 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1267ed04 Branch: refs/heads/TINKERPOP-1612 Commit: 1267ed047f2f6fe0c2085e0d4a120cb1b463cd76 Parents: 1af9ba6 Author: Alan BoudreaultAuthored: Fri Jan 27 10:48:54 2017 -0500 Committer: Alan Boudreault Committed: Fri Jan 27 10:48:54 2017 -0500 -- .../src/main/jython/gremlin_python/structure/io/graphson.py| 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1267ed04/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py -- diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py index 31d9d65..f33f528 100644 --- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py +++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py @@ -293,11 +293,7 @@ class Int32IO(_NumberIO): def dictify(cls, n, writer): if isinstance(n, bool): return n -if isinstance(n, LongType): -graphson_base_type = Int64IO.graphson_base_type -else: -graphson_base_type = cls.graphson_base_type -return GraphSONUtil.typedValue(graphson_base_type, n) +return GraphSONUtil.typedValue(cls.graphson_base_type, n) class VertexDeserializer(_GraphSONTypeIO):
[27/45] 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/65e8edb3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/65e8edb3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/65e8edb3 Branch: refs/heads/TINKERPOP-1612 Commit: 65e8edb38128f9b6a6093c0ff633b35e3b791289 Parents: 77de295 1820606 Author: Stephen MalletteAuthored: Mon Jan 30 07:49:58 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 07:49:58 2017 -0500 -- CHANGELOG.asciidoc | 1 + .../groovy/jsr223/GremlinGroovyClassLoader.java | 24 - .../jsr223/ManagedConcurrentValueMap.java | 4 ++ .../GremlinGroovyScriptEngineIntegrateTest.java | 55 4 files changed, 82 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/65e8edb3/CHANGELOG.asciidoc --
[04/45] tinkerpop git commit: Added check for MatchStep.Select.FilterStep pattern so that MatchStep start and end keys are preserved correctly.
Added check for MatchStep.Select.FilterStep pattern so that MatchStep start and end keys are preserved correctly. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cf7a0777 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cf7a0777 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cf7a0777 Branch: refs/heads/TINKERPOP-1612 Commit: cf7a0777d4a1d0053e5b6c5a8e7fa6ca5166d05a Parents: da762df Author: Ted WilmesAuthored: Fri Jan 27 08:21:34 2017 -0600 Committer: Ted Wilmes Committed: Fri Jan 27 08:21:34 2017 -0600 -- .../strategy/optimization/PathRetractionStrategy.java | 9 - .../strategy/optimization/PathRetractionStrategyTest.java | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf7a0777/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java index fc7eb8a..da6fd0e 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java @@ -27,8 +27,12 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep; import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; @@ -95,7 +99,10 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategyhttp://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf7a0777/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java index 71b0ad5..d12b621 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java @@ -179,7 +179,7 @@ public class PathRetractionStrategyTest { "[[[z, seen]], [[z, seen]]]", null}, {__.V().as("a").optional(bothE().dedup().as("b")). choose(select("b"), select("a","b"), project("a").by(select("a"))), -"[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, b]]]", null} +"[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, b]]]", null}, }); } }
[28/45] tinkerpop git commit: Merge branch 'pr-551' into tp32
Merge branch 'pr-551' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5aa3f40d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5aa3f40d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5aa3f40d Branch: refs/heads/TINKERPOP-1612 Commit: 5aa3f40db7bcc902f0fc524b0375b7c4eff48351 Parents: 1820606 1267ed0 Author: Stephen MalletteAuthored: Mon Jan 30 11:19:06 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 11:19:06 2017 -0500 -- .../jython/gremlin_python/structure/io/graphson.py | 16 1 file changed, 8 insertions(+), 8 deletions(-) --
[26/45] tinkerpop git commit: Merge branch 'TINKERPOP-1560' into tp32
Merge branch 'TINKERPOP-1560' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1820606f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1820606f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1820606f Branch: refs/heads/TINKERPOP-1612 Commit: 1820606f23070ebdafdf7b4545da338d1b5914a0 Parents: cf42573 9726577 Author: Stephen MalletteAuthored: Mon Jan 30 07:49:45 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 07:49:45 2017 -0500 -- CHANGELOG.asciidoc | 1 + .../groovy/jsr223/GremlinGroovyClassLoader.java | 24 - .../jsr223/ManagedConcurrentValueMap.java | 4 ++ .../GremlinGroovyScriptEngineIntegrateTest.java | 55 4 files changed, 82 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1820606f/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 76d9ef5,5e06a1c..91413c1 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -35,9 -32,9 +35,10 @@@ TinkerPop 3.2.4 (Release Date: NOT OFFI * Fixed an optimization bug in `CollectionBarrierSteps` where the barrier was being consumed on each `addBarrier()`. * `OrderGlobalStep` and `SampleGlobalStep` use `ProjectedTraverser` and now can work up to the local star graph in OLAP. * SASL negotiation supports both a byte array and Base64 encoded bytes as a string for authentication to Gremlin Server. +* Deprecated all test suites in `gremlin-groovy-test` - Graph Providers no longer need to implement these. * Deprecated `TinkerIoRegistry` replacing it with the more consistently named `TinkerIoRegistryV1d0`. * Made error messaging more consistent during result iteration timeouts in Gremlin Server. + * Fixed a memory leak in the classloader for the `GremlinGroovyScriptEngine` where classes in the loader were not releasing from memory as a strong reference was always maintained. * `PathRetractionStrategy` does not add a `NoOpBarrierStep` to the end of local children as its wasted computation in 99% of traversals. * Fixed a bug in `AddVertexStartStep` where if a side-effect was being used in the parametrization, an NPE occurred. * Fixed a bug in `LazyBarrierStrategy` where `profile()` was deactivating it accidentally.
[03/45] tinkerpop git commit: Fix the serializers lookup to handle the type first, then the class inheritance.
Fix the serializers lookup to handle the type first, then the class inheritance. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1af9ba6f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1af9ba6f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1af9ba6f Branch: refs/heads/TINKERPOP-1612 Commit: 1af9ba6fe24f5425d8f18ab4d34ea536fd91e77e Parents: c958b22 Author: Alan BoudreaultAuthored: Fri Jan 27 08:43:35 2017 -0500 Committer: Alan Boudreault Committed: Fri Jan 27 09:14:38 2017 -0500 -- .../main/jython/gremlin_python/structure/io/graphson.py | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1af9ba6f/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py -- diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py index 85e161d..31d9d65 100644 --- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py +++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py @@ -75,9 +75,13 @@ class GraphSONWriter(object): """ Encodes python objects in GraphSON type-tagged dict values """ -for key, serializer in self.serializers.items(): -if isinstance(obj, key): -return serializer.dictify(obj, self) +try: +return self.serializers[type(obj)].dictify(obj, self) +except KeyError: +for key, serializer in self.serializers.items(): +if isinstance(obj, key): +return serializer.dictify(obj, self) + # list and map are treated as normal json objs (could be isolated serializers) if isinstance(obj, (list, set)): return [self.toDict(o) for o in obj]
[25/45] 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/77de2950 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/77de2950 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/77de2950 Branch: refs/heads/TINKERPOP-1612 Commit: 77de2950fee323fe8a868fb254d73bc5774033cd Parents: f7f0bc4 cf42573 Author: Stephen MalletteAuthored: Mon Jan 30 06:36:56 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 06:36:56 2017 -0500 -- gremlin-python/src/main/jython/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[23/45] tinkerpop git commit: Update to test to account for new OptionalStep CTR
Update to test to account for new OptionalStep CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f7f0bc40 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f7f0bc40 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f7f0bc40 Branch: refs/heads/TINKERPOP-1612 Commit: f7f0bc40f383a3acd51fc762cbc8946f630ad50f Parents: 4917d88 Author: Ted WilmesAuthored: Fri Jan 27 16:55:40 2017 -0600 Committer: Ted Wilmes Committed: Fri Jan 27 16:55:40 2017 -0600 -- .../strategy/optimization/PathRetractionStrategyTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f7f0bc40/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java index 2f99fd2..8756fbc 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java @@ -190,7 +190,7 @@ public class PathRetractionStrategyTest { "[[[z, seen]], [[z, seen]]]", null}, {__.V().as("a").optional(bothE().dedup().as("b")). choose(select("b"), select("a","b"), project("a").by(select("a"))), -"[[[a, b]], [[a, b]], [[a, b]], [[[a, b]]], [[a, b]]]", null}, +"[[[a, b]], [[a, b]], [[[a, b]]], [[a, b]]]", null}, }); } }
[16/45] 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/a71f5650 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a71f5650 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a71f5650 Branch: refs/heads/TINKERPOP-1612 Commit: a71f5650c2e8b14eb52985382a149aefdd4574d7 Parents: 7b3adca c2a42e2 Author: Marko A. RodriguezAuthored: Fri Jan 27 14:24:53 2017 -0700 Committer: Marko A. Rodriguez Committed: Fri Jan 27 14:24:53 2017 -0700 -- CHANGELOG.asciidoc | 3 + .../step/map/TraversalVertexProgramStep.java| 5 + .../MessagePassingReductionStrategy.java| 162 +++ .../process/traversal/TraversalStrategies.java | 2 + .../optimization/PathRetractionStrategy.java| 66 ++-- .../MessagePassingReductionStrategyTest.java| 135 .../PathRetractionStrategyTest.java | 18 ++- .../SparkSingleIterationStrategy.java | 15 +- .../SparkSingleIterationStrategyTest.java | 118 -- 9 files changed, 494 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a71f5650/CHANGELOG.asciidoc --
[09/45] tinkerpop git commit: remove tests from setup.py
remove tests from setup.py Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8152a5b7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8152a5b7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8152a5b7 Branch: refs/heads/TINKERPOP-1612 Commit: 8152a5b7d4313712a3ffdacf29393c06e2e8a1ec Parents: c958b22 Author: GregBestlandAuthored: Fri Jan 27 15:15:33 2017 -0600 Committer: GregBestland Committed: Fri Jan 27 15:15:33 2017 -0600 -- gremlin-python/src/main/jython/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8152a5b7/gremlin-python/src/main/jython/setup.py -- diff --git a/gremlin-python/src/main/jython/setup.py b/gremlin-python/src/main/jython/setup.py index 3c4..6878c34 100644 --- a/gremlin-python/src/main/jython/setup.py +++ b/gremlin-python/src/main/jython/setup.py @@ -46,7 +46,7 @@ version = __version__.version setup( name='gremlinpython', version=version, -packages=['gremlin_python', 'gremlin_python.driver', 'gremlin_python.process', 'gremlin_python.structure', 'gremlin_python.structure.io', 'tests'], +packages=['gremlin_python', 'gremlin_python.driver', 'gremlin_python.process', 'gremlin_python.structure', 'gremlin_python.structure.io'], license='Apache 2', url='http://tinkerpop.apache.org', description='Gremlin-Python for Apache TinkerPop',
[31/45] 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/b7aa9485 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b7aa9485 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b7aa9485 Branch: refs/heads/TINKERPOP-1612 Commit: b7aa94859492baf2412f6f5763976853fec8dce8 Parents: a98fb13 8f34da8 Author: Stephen MalletteAuthored: Mon Jan 30 15:11:09 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:11:09 2017 -0500 -- docs/src/reference/implementations-hadoop.asciidoc | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) --
[45/45] tinkerpop git commit: TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j
TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j That used to come in as part of gremlin-groovy, but since neo4j-gremlin no longer depends on that we need to remove the exclusion. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d53b0d05 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d53b0d05 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d53b0d05 Branch: refs/heads/TINKERPOP-1612 Commit: d53b0d05eb4aa0d97576ee2606c0272e0f4f0881 Parents: 56d54d9 Author: Stephen MalletteAuthored: Thu Jan 26 10:58:14 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:16:06 2017 -0500 -- neo4j-gremlin/pom.xml | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d53b0d05/neo4j-gremlin/pom.xml -- diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index cedd11e..7602cc0 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -122,10 +122,6 @@ limitations under the License. test -org.apache.commons -commons-lang3 - - com.googlecode.concurrentlinkedhashmap concurrentlinkedhashmap-lru
[10/45] tinkerpop git commit: I just made SingleIterationStrategy a whole lot smarter. Not only is the code simpler with less checks, we now support out().count() -> out().id().count() and out().dedup
I just made SingleIterationStrategy a whole lot smarter. Not only is the code simpler with less checks, we now support out().count() -> out().id().count() and out().dedup().count() as out().id().dedup().count(). This will constrain numerous star local traversers from message passing in all GraphComputer implementations. Again, for Spark, this means we don't have to worry about caching the graph and save lots of clock cycles on many typical queries. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1819e05a Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1819e05a Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1819e05a Branch: refs/heads/TINKERPOP-1612 Commit: 1819e05aa1545f14ae97a78c3626d38b732ead9d Parents: b2f2a9d Author: Marko A. RodriguezAuthored: Fri Jan 27 06:26:22 2017 -0700 Committer: Marko A. Rodriguez Committed: Fri Jan 27 14:24:18 2017 -0700 -- .../optimization/SingleIterationStrategy.java | 105 +++ .../SingleIterationStrategyTest.java| 38 --- .../SparkSingleIterationStrategyTest.java | 20 ++-- 3 files changed, 97 insertions(+), 66 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1819e05a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java index 96a2a0a..6b509ef 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java @@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimiz import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.TraversalVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.util.EmptyMemory; -import org.apache.tinkerpop.gremlin.process.traversal.Scope; import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; @@ -29,14 +28,18 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTrav import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder; -import org.apache.tinkerpop.gremlin.process.traversal.step.SideEffectCapable; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaFlatMapStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaMapStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.IdStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.TraversalFlatMapStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.TraversalMapStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep; import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy; @@ -45,7 +48,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.Inci import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; -import
[13/45] tinkerpop git commit: Added SingleIterationStrategy which is able to rewrite a set of traversals to not use message passing in OLAP. This is signficant for all GraphComputers as message passin
Added SingleIterationStrategy which is able to rewrite a set of traversals to not use message passing in OLAP. This is signficant for all GraphComputers as message passing is expense and furthermore, for SparkGraphComputer as without message-passing, there is no need to cache or partition the graph once loaded. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f6b66977 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f6b66977 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f6b66977 Branch: refs/heads/TINKERPOP-1612 Commit: f6b669778ec058a555623c6119e0feaaac59c8be Parents: f0875d7 Author: Marko A. RodriguezAuthored: Thu Jan 26 12:57:58 2017 -0700 Committer: Marko A. Rodriguez Committed: Fri Jan 27 14:24:18 2017 -0700 -- CHANGELOG.asciidoc | 3 +- .../step/map/TraversalVertexProgramStep.java| 5 + .../optimization/SingleIterationStrategy.java | 132 +++ .../process/traversal/TraversalStrategies.java | 2 + .../SingleIterationStrategyTest.java| 100 ++ .../SparkSingleIterationStrategy.java | 48 ++- .../SparkSingleIterationStrategyTest.java | 89 +++-- 7 files changed, 362 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6b66977/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 95cfb71..860d401 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,7 +26,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ -* Fixed a bug where `keepLabels` were not being pushed down into child traversals by `PathRetractionStrategy`. +* Fixed a bug where `PathProcessor.keepLabels` were not being pushed down into child traversals by `PathRetractionStrategy`. +* Added `SingleIterationStrategy` as a default `GraphComputer` strategy that can re-write some traversals to not require message passing. * Fixed a bug associated with user-provided maps and `GroupSideEffectStep`. * `GroupBiOperator` no longer maintains a detached traversal and thus, no more side-effect related OLAP inconsistencies. * Added `ProjectedTraverser` which wraps a traverser with a `List` of projected data. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6b66977/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java index cb7db29..e866ce2 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java @@ -54,6 +54,11 @@ public final class TraversalVertexProgramStep extends VertexProgramStep implemen return Collections.singletonList(this.computerTraversal.get()); } +public void setComputerTraversal(final Traversal.Admin computerTraversal) { +this.computerTraversal = new PureTraversal<>(computerTraversal); +this.integrateChild(this.computerTraversal.get()); +} + @Override public String toString() { return StringFactory.stepString(this, this.computerTraversal.get(), new GraphFilter(this.computer)); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6b66977/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java new file mode 100644 index 000..efcbe9a --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + *
[43/45] tinkerpop git commit: TINKERPOP-1612 Removed mode for old plugin system in console
TINKERPOP-1612 Removed mode for old plugin system in console In 3.2.4 the new plugin system was introduced. It was designed to run parallel to the old so there was some extra code in the console to allow it to load either the old plugin system or the new. Since TinkerGraph has removed its plugin due to removal of gremlin-groovy as a dependency, the old plugin system had to be removed as well for 3.3.0 or else no tinkergraph stuff will load in the console. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6e33a315 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6e33a315 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6e33a315 Branch: refs/heads/TINKERPOP-1612 Commit: 6e33a3159148d3b0f90403052fcfc5f6d19c9830 Parents: d53b0d0 Author: Stephen MalletteAuthored: Mon Jan 30 14:36:56 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:16:06 2017 -0500 -- .../giraph/jsr223/GiraphGremlinPlugin.java | 2 +- gremlin-console/src/main/ext/plugins.txt| 6 +- .../tinkerpop/gremlin/console/Console.groovy| 29 ++-- .../tinkerpop/gremlin/console/Mediator.groovy | 2 - .../console/commands/InstallCommand.groovy | 14 +--- .../gremlin/jsr223/CoreGremlinModule.java | 62 .../tinkerpop/gremlin/jsr223/CoreImports.java | 45 .../DefaultGremlinScriptEngineManager.java | 25 --- .../tinkerpop/gremlin/jsr223/GremlinModule.java | 74 .../jsr223/GremlinScriptEngineManager.java | 8 --- .../jsr223/GremlinEnabledScriptEngineTest.java | 25 --- 11 files changed, 59 insertions(+), 233 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e33a315/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java -- diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java index ee49ed5..c512335 100644 --- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java +++ b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/jsr223/GiraphGremlinPlugin.java @@ -38,7 +38,7 @@ public final class GiraphGremlinPlugin extends AbstractGremlinPlugin { private static final String MODULE_NAME = "tinkerpop.giraph"; private static final GiraphGremlinPlugin instance = new GiraphGremlinPlugin(); -private GiraphGremlinPlugin() { +public GiraphGremlinPlugin() { super(MODULE_NAME, DefaultImportCustomizer.build().addClassImports( EmptyOutEdges.class, GiraphComputation.class, http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e33a315/gremlin-console/src/main/ext/plugins.txt -- diff --git a/gremlin-console/src/main/ext/plugins.txt b/gremlin-console/src/main/ext/plugins.txt index 2b1a2e7..7eb2b23 100644 --- a/gremlin-console/src/main/ext/plugins.txt +++ b/gremlin-console/src/main/ext/plugins.txt @@ -1,3 +1,3 @@ -org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverGremlinPlugin -org.apache.tinkerpop.gremlin.console.groovy.plugin.UtilitiesGremlinPlugin -org.apache.tinkerpop.gremlin.tinkergraph.groovy.plugin.TinkerGraphGremlinPlugin \ No newline at end of file +org.apache.tinkerpop.gremlin.console.jsr223.DriverGremlinPlugin +org.apache.tinkerpop.gremlin.console.jsr223.UtilitiesGremlinPlugin +org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6e33a315/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy -- diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy index 15d8208..9f51548 100644 --- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy +++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy @@ -30,8 +30,8 @@ import org.apache.tinkerpop.gremlin.console.commands.SubmitCommand import org.apache.tinkerpop.gremlin.console.commands.UninstallCommand import org.apache.tinkerpop.gremlin.console.plugin.PluggedIn import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader -import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin import org.apache.tinkerpop.gremlin.jsr223.CoreGremlinPlugin
[18/45] tinkerpop git commit: updated doc for ssl client auth
updated doc for ssl client auth Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9b279c6b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9b279c6b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9b279c6b Branch: refs/heads/TINKERPOP-1612 Commit: 9b279c6b738f1cbe8eceab88f0269ceb971b615a Parents: c62480b Author: Robert DaleAuthored: Tue Jan 17 14:39:32 2017 -0500 Committer: Robert Dale Committed: Fri Jan 27 16:26:32 2017 -0500 -- docs/src/reference/gremlin-applications.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b279c6b/docs/src/reference/gremlin-applications.asciidoc -- diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index e515ef7..2454581 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -1036,7 +1036,8 @@ The following table describes the various configuration options that Gremlin Ser |ssl.keyCertChainFile |The X.509 certificate chain file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_ |ssl.keyFile |The `PKCS#8` private key file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_ |ssl.keyPassword |The password of the `keyFile` if it is password-protected |_none_ -|ssl.trustCertChainFile |Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate chain in PEM format. A system default will be used if this setting is not present. (Not supported) |_none_ +|ssl.needClientAuth | Optional. One of NONE, OPTIONAL, REQUIRE. Enables client certificate authentication at the level specified. Can be used in combination with Authenticator. |_none_ +|ssl.trustCertChainFile | Required when needClientAuth is OPTIONAL or REQUIRE. Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate chain in PEM format. |_none_ |strictTransactionManagement |Set to `true` to require `aliases` to be submitted on every requests, where the `aliases` become the scope of transaction management. |false |threadPoolBoss |The number of threads available to Gremlin Server for accepting connections. Should always be set to `1`. |1 |threadPoolWorker |The number of threads available to Gremlin Server for processing non-blocking reads and writes. |1
[30/45] tinkerpop git commit: HADOOP_GREMLIN_LIBS does not need "spark"
HADOOP_GREMLIN_LIBS does not need "spark" This causes more problems in 3.3.0 where Spark 2.0 generates errors if duplicate jars are on the path. Having "spark-gremlin" with "hadoop-gremlin" immediately causes problems. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8f34da82 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8f34da82 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8f34da82 Branch: refs/heads/TINKERPOP-1612 Commit: 8f34da823f7bea4674e2ee41d9f11b0c2aa76660 Parents: 5aa3f40 Author: Stephen MalletteAuthored: Mon Jan 30 15:05:16 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:05:16 2017 -0500 -- docs/src/reference/implementations-hadoop.asciidoc | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f34da82/docs/src/reference/implementations-hadoop.asciidoc -- diff --git a/docs/src/reference/implementations-hadoop.asciidoc b/docs/src/reference/implementations-hadoop.asciidoc index 3416ea8..d3b340c 100644 --- a/docs/src/reference/implementations-hadoop.asciidoc +++ b/docs/src/reference/implementations-hadoop.asciidoc @@ -265,14 +265,8 @@ arguably easier for developers to work with than native Hadoop MapReduce. Spark- the bulk-synchronous parallel, distributed message passing algorithm within Spark and thus, any `VertexProgram` can be executed over `SparkGraphComputer`. -If `SparkGraphComputer` will be used as the `GraphComputer` for `HadoopGraph` then its `lib` directory should be -specified in `HADOOP_GREMLIN_LIBS`. - -[source,shell] -export HADOOP_GREMLIN_LIBS=$HADOOP_GREMLIN_LIBS:/usr/local/gremlin-console/ext/spark-gremlin/lib - -Furthermore the `lib/` directory should be distributed across all machines in the SparkServer cluster. For this purpose TinkerPop -provides a helper script, which takes the Spark installation directory and the Spark machines as input: +Furthermore the `lib/` directory should be distributed across all machines in the SparkServer cluster. For this purpose +TinkerPop provides a helper script, which takes the Spark installation directory and the Spark machines as input: [source,shell] bin/hadoop/init-tp-spark.sh /usr/local/spark spark@10.0.0.1 spark@10.0.0.2 spark@10.0.0.3
[17/45] tinkerpop git commit: Support SSL client auth
Support SSL client auth Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c62480bb Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c62480bb Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c62480bb Branch: refs/heads/TINKERPOP-1612 Commit: c62480bbd563b9904654c23abdc66c4b4828b64e Parents: c2a42e2 Author: Robert DaleAuthored: Tue Jan 17 14:24:00 2017 -0500 Committer: Robert Dale Committed: Fri Jan 27 16:26:32 2017 -0500 -- .../apache/tinkerpop/gremlin/server/AbstractChannelizer.java | 4 +++- .../java/org/apache/tinkerpop/gremlin/server/Settings.java | 6 ++ 2 files changed, 9 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c62480bb/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java index 57c6994..d28fd4f 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java @@ -242,8 +242,10 @@ public abstract class AbstractChannelizer extends ChannelInitializerhttp://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c62480bb/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java index 97e2875..a3b9545 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java @@ -18,6 +18,7 @@ */ package org.apache.tinkerpop.gremlin.server; +import io.netty.handler.ssl.ClientAuth; import io.netty.handler.ssl.SslContext; import org.apache.tinkerpop.gremlin.driver.MessageSerializer; import org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin; @@ -420,6 +421,11 @@ public class Settings { * contain an X.509 certificate chain in PEM format. {@code null} uses the system default. */ public String trustCertChainFile = null; + +/** + * Require client certificate authentication + */ +public ClientAuth needClientAuth = ClientAuth.NONE; private SslContext sslContext;
[06/45] tinkerpop git commit: Removed unused and wildcard imports.
Removed unused and wildcard imports. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cbd1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cbd1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cbd1 Branch: refs/heads/TINKERPOP-1612 Commit: cbd1343e7b867e0db8c712e2bf5f0392b961 Parents: cf7a077 Author: Ted WilmesAuthored: Fri Jan 27 13:15:02 2017 -0600 Committer: Ted Wilmes Committed: Fri Jan 27 13:15:02 2017 -0600 -- .../optimization/PathRetractionStrategy.java | 3 --- .../optimization/PathRetractionStrategyTest.java | 19 +++ 2 files changed, 15 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbd1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java index da6fd0e..439d568 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java @@ -28,8 +28,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep; @@ -38,7 +36,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.PathUtil; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; -import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import org.javatuples.Pair; import java.util.ArrayList; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbd1/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java index d12b621..2f99fd2 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java @@ -37,8 +37,19 @@ import java.util.Arrays; import java.util.List; import java.util.Set; -import static org.apache.tinkerpop.gremlin.process.traversal.P.*; -import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*; +import static org.apache.tinkerpop.gremlin.process.traversal.P.eq; +import static org.apache.tinkerpop.gremlin.process.traversal.P.gte; +import static org.apache.tinkerpop.gremlin.process.traversal.P.neq; +import static org.apache.tinkerpop.gremlin.process.traversal.P.without; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.as; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.bothE; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.limit; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.project; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.select; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.store; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.values; +import static
[12/45] tinkerpop git commit: added a butt load more test cases verifying will crazy corner cases.
added a butt load more test cases verifying will crazy corner cases. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/989237fd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/989237fd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/989237fd Branch: refs/heads/TINKERPOP-1612 Commit: 989237fd07a5693121400fe60bb3890c6573543d Parents: f6b6697 Author: Marko A. RodriguezAuthored: Thu Jan 26 15:02:05 2017 -0700 Committer: Marko A. Rodriguez Committed: Fri Jan 27 14:24:18 2017 -0700 -- .../optimization/SingleIterationStrategy.java | 22 - .../SingleIterationStrategyTest.java| 34 ++-- .../SparkSingleIterationStrategy.java | 17 +- .../SparkSingleIterationStrategyTest.java | 26 ++- 4 files changed, 73 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/989237fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java index efcbe9a..19d9854 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/SingleIterationStrategy.java @@ -29,9 +29,11 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTrav import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder; +import org.apache.tinkerpop.gremlin.process.traversal.step.SideEffectCapable; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaFlatMapStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaMapStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep; @@ -41,6 +43,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.Adja import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Graph; @@ -93,22 +96,25 @@ public final class SingleIterationStrategy extends AbstractTraversalStrategy !parent.getGlobalChildren().isEmpty()).findAny().isPresent())) { final Traversal.Admin newComputerTraversal = step.computerTraversal.getPure(); final Traversal.Admin localTraversal = new DefaultGraphTraversal<>(); final Step barrier = (Step) TraversalHelper.getFirstStepOfAssignableClass(Barrier.class, newComputerTraversal).orElse(null); -final Step endStep = null == barrier ? newComputerTraversal.getEndStep() : barrier.getPreviousStep(); -if (!(endStep instanceof VertexStep || endStep instanceof EdgeVertexStep)) { +if (null == barrier || !(barrier instanceof TraversalParent && (barrier.getPreviousStep() instanceof VertexStep || barrier.getPreviousStep() instanceof EdgeVertexStep))) { TraversalHelper.removeToTraversal(newComputerTraversal.getStartStep().getNextStep(), null == barrier ? EmptyStep.instance() : barrier, localTraversal); assert !localTraversal.getSteps().isEmpty(); // given the if() constraints, this is impossible -if (localTraversal.getSteps().size() > 1) { // if its just a single step, a local wrap will not alter its locus of computation +
[02/45] tinkerpop git commit: Fixed a bug where keepLabels were not being pushed down into child traversals by PathRetractionStrategy.
Fixed a bug where keepLabels were not being pushed down into child traversals by PathRetractionStrategy. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/da762dfe Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/da762dfe Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/da762dfe Branch: refs/heads/TINKERPOP-1612 Commit: da762dfee9b0ed05fd1185d80403e1be41873b58 Parents: e3889bf Author: Ted WilmesAuthored: Tue Jan 24 14:57:07 2017 -0600 Committer: Ted Wilmes Committed: Tue Jan 24 14:57:07 2017 -0600 -- CHANGELOG.asciidoc | 1 + .../optimization/PathRetractionStrategy.java| 58 +--- .../PathRetractionStrategyTest.java | 19 +++ 3 files changed, 60 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da762dfe/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 9453158..95cfb71 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.4 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Fixed a bug where `keepLabels` were not being pushed down into child traversals by `PathRetractionStrategy`. * Fixed a bug associated with user-provided maps and `GroupSideEffectStep`. * `GroupBiOperator` no longer maintains a detached traversal and thus, no more side-effect related OLAP inconsistencies. * Added `ProjectedTraverser` which wraps a traverser with a `List` of projected data. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da762dfe/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java index fcc22a4..fc7eb8a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java @@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder; import org.apache.tinkerpop.gremlin.process.traversal.step.PathProcessor; +import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupGlobalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep; @@ -33,6 +34,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.PathUtil; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import org.javatuples.Pair; import java.util.ArrayList; @@ -96,8 +98,12 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy(keepLabels)); +} else { +if (pathProcessor.getKeepLabels() == null) +pathProcessor.setKeepLabels(new HashSet<>(keepLabels)); +else +pathProcessor.getKeepLabels().addAll(new HashSet<>(keepLabels)); +} if (currentStep.getTraversal().getParent() instanceof MatchStep) { pathProcessor.setKeepLabels(((MatchStep) currentStep.getTraversal().getParent().asStep()).getMatchStartLabels()); @@ -111,6 +117,7 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy(traversal, this.standardBarrierSize), currentStep, traversal); } } @@ -141,16 +148,29 @@ public final class PathRetractionStrategy extends AbstractTraversalStrategy> children = new ArrayList<>(); +children.addAll(((TraversalParent) step).getGlobalChildren()); +children.addAll(((TraversalParent) step).getLocalChildren()); +// if this is
[39/45] tinkerpop git commit: TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/56d54d99/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin -- diff --git a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin b/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin deleted file mode 100644 index 0399720..000 --- a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin +++ /dev/null @@ -1 +0,0 @@ -org.apache.tinkerpop.gremlin.spark.groovy.plugin.SparkGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/56d54d99/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java -- diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java index 6cdcb67..74e1207 100644 --- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java +++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java @@ -22,32 +22,25 @@ import org.apache.spark.launcher.SparkLauncher; import org.apache.spark.serializer.KryoSerializer; import org.apache.tinkerpop.gremlin.GraphProvider; import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.hadoop.Constants; import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider; -import org.apache.tinkerpop.gremlin.hadoop.groovy.plugin.HadoopGremlinPluginCheck; +import org.apache.tinkerpop.gremlin.hadoop.jsr223.HadoopGremlinPluginCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorageCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools; -import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry; import org.apache.tinkerpop.gremlin.process.computer.Computer; import org.apache.tinkerpop.gremlin.process.computer.GraphComputer; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPageRankTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPeerPressureTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyProgramTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PeerPressureTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; import org.apache.tinkerpop.gremlin.spark.structure.Spark; import org.apache.tinkerpop.gremlin.spark.structure.io.PersistedOutputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorageCheck; -import org.apache.tinkerpop.gremlin.spark.structure.io.SparkIoRegistryCheck; import org.apache.tinkerpop.gremlin.spark.structure.io.ToyGraphInputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator; +import org.apache.tinkerpop.gremlin.spark.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.io.IoRegistry; -import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimService; import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader; import java.util.Map; @@ -75,11 +68,8 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { // toy graph inputRDD does not have corresponding outputRDD so where jobs chain, it fails (failing makes sense) if (null != loadGraphWith && !test.equals(ProgramTest.Traversals.class) && -!test.equals(GroovyProgramTest.Traversals.class) && !test.equals(PageRankTest.Traversals.class) && -!test.equals(GroovyPageRankTest.Traversals.class) && !test.equals(PeerPressureTest.Traversals.class) && -!test.equals(GroovyPeerPressureTest.Traversals.class) && !test.equals(FileSystemStorageCheck.class) && !testMethodName.equals("shouldSupportJobChaining") && // GraphComputerTest.shouldSupportJobChaining RANDOM.nextBoolean()) { @@ -97,7 +87,7 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { Spark.close(); HadoopPools.close();
[38/45] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1fc52939 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1fc52939 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1fc52939 Branch: refs/heads/TINKERPOP-1612 Commit: 1fc52939f3277e51bb2b5bc4ea77d91632e49dbb Parents: b7aa948 Author: Stephen MalletteAuthored: Tue Jan 24 07:22:07 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:16:06 2017 -0500 -- gremlin-groovy-test/pom.xml | 64 --- .../groovy/loaders/SugarLoaderTest.groovy | 134 -- .../gremlin/groovy/util/SugarTestHelper.groovy | 37 -- .../step/branch/GroovyBranchTest.groovy | 58 --- .../step/branch/GroovyChooseTest.groovy | 62 --- .../step/branch/GroovyLocalTest.groovy | 91 - .../step/branch/GroovyOptionalTest.groovy | 59 --- .../step/branch/GroovyRepeatTest.groovy | 88 .../step/branch/GroovyUnionTest.groovy | 77 .../traversal/step/filter/GroovyAndTest.groovy | 52 --- .../traversal/step/filter/GroovyCoinTest.groovy | 41 -- .../step/filter/GroovyCyclicPathTest.groovy | 43 -- .../step/filter/GroovyDedupTest.groovy | 113 -- .../traversal/step/filter/GroovyDropTest.groovy | 51 --- .../step/filter/GroovyFilterTest.groovy | 73 .../traversal/step/filter/GroovyHasTest.groovy | 173 .../traversal/step/filter/GroovyIsTest.groovy | 57 --- .../traversal/step/filter/GroovyOrTest.groovy | 47 --- .../step/filter/GroovyRangeTest.groovy | 127 -- .../step/filter/GroovySampleTest.groovy | 58 --- .../step/filter/GroovySimplePathTest.groovy | 43 -- .../traversal/step/filter/GroovyTailTest.groovy | 92 - .../step/filter/GroovyWhereTest.groovy | 167 .../traversal/step/map/GroovyAddEdgeTest.groovy | 85 .../step/map/GroovyAddVertexTest.groovy | 101 - .../step/map/GroovyCoalesceTest.groovy | 59 --- .../step/map/GroovyConstantTest.groovy | 42 -- .../traversal/step/map/GroovyCountTest.groovy | 71 .../traversal/step/map/GroovyFlatMapTest.groovy | 36 -- .../traversal/step/map/GroovyFoldTest.groovy| 46 --- .../traversal/step/map/GroovyGraphTest.groovy | 55 --- .../traversal/step/map/GroovyLoopsTest.groovy | 56 --- .../traversal/step/map/GroovyMapKeysTest.groovy | 43 -- .../traversal/step/map/GroovyMapTest.groovy | 62 --- .../step/map/GroovyMapValuesTest.groovy | 48 --- .../traversal/step/map/GroovyMatchTest.groovy | 381 - .../traversal/step/map/GroovyMaxTest.groovy | 47 --- .../traversal/step/map/GroovyMeanTest.groovy| 42 -- .../traversal/step/map/GroovyMinTest.groovy | 47 --- .../traversal/step/map/GroovyOrderTest.groovy | 140 --- .../step/map/GroovyPageRankTest.groovy | 78 .../traversal/step/map/GroovyPathTest.groovy| 63 --- .../step/map/GroovyPeerPressureTest.groovy | 48 --- .../traversal/step/map/GroovyProfileTest.groovy | 94 - .../traversal/step/map/GroovyProgramTest.groovy | 50 --- .../traversal/step/map/GroovyProjectTest.groovy | 42 -- .../step/map/GroovyPropertiesTest.groovy| 60 --- .../traversal/step/map/GroovySelectTest.groovy | 242 --- .../traversal/step/map/GroovySumTest.groovy | 42 -- .../traversal/step/map/GroovyUnfoldTest.groovy | 48 --- .../step/map/GroovyValueMapTest.groovy | 51 --- .../traversal/step/map/GroovyVertexTest.groovy | 187 - .../step/sideEffect/GroovyAggregateTest.groovy | 53 --- .../step/sideEffect/GroovyExplainTest.groovy| 35 -- .../step/sideEffect/GroovyGroupCountTest.groovy | 101 - .../step/sideEffect/GroovyGroupTest.groovy | 137 --- .../step/sideEffect/GroovyGroupTestV3d0.groovy | 74 .../step/sideEffect/GroovyInjectTest.groovy | 42 -- .../step/sideEffect/GroovySackTest.groovy | 84 .../sideEffect/GroovySideEffectCapTest.groovy | 45 -- .../step/sideEffect/GroovySideEffectTest.groovy | 83 .../step/sideEffect/GroovyStoreTest.groovy | 53 --- .../step/sideEffect/GroovySubgraphTest.groovy | 50 --- .../step/sideEffect/GroovyTreeTest.groovy | 69 .../groovy/GroovyEnvironmentIntegrateSuite.java | 85 .../gremlin/groovy/GroovyEnvironmentSuite.java | 92 - .../engine/GremlinExecutorOverGraphTest.java| 108 - ...remlinGroovyScriptEngineFileSandboxTest.java | 120 -- .../GremlinGroovyScriptEngineIntegrateTest.java | 88 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 - ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
[15/45] tinkerpop git commit: realize that we can generalized SingleIterationStrategy to 1) work with GraphActors and 2) work at every walk-step. Thus, given that GraphActors isn't about Iterations an
realize that we can generalized SingleIterationStrategy to 1) work with GraphActors and 2) work at every walk-step. Thus, given that GraphActors isn't about Iterations and we can make this work for multi-stages, I renamed the strategy MessagePassingReductionStrategy. This way we won't have to name change in the future. Also, I did some more code cleanups and added a bunch more test cases. This is perhaps the most tested strategy. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c2a42e27 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c2a42e27 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c2a42e27 Branch: refs/heads/TINKERPOP-1612 Commit: c2a42e27f901b95c66e31562940a176b9f932692 Parents: 1819e05 Author: Marko A. RodriguezAuthored: Fri Jan 27 11:30:15 2017 -0700 Committer: Marko A. Rodriguez Committed: Fri Jan 27 14:24:35 2017 -0700 -- CHANGELOG.asciidoc | 1 + .../MessagePassingReductionStrategy.java| 162 +++ .../optimization/SingleIterationStrategy.java | 151 - .../process/traversal/TraversalStrategies.java | 4 +- .../MessagePassingReductionStrategyTest.java| 135 .../SingleIterationStrategyTest.java| 128 --- .../SparkSingleIterationStrategy.java | 42 + .../SparkSingleIterationStrategyTest.java | 17 +- 8 files changed, 314 insertions(+), 326 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2a42e27/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 860d401..d523ae2 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,6 +28,7 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET) * Fixed a bug where `PathProcessor.keepLabels` were not being pushed down into child traversals by `PathRetractionStrategy`. * Added `SingleIterationStrategy` as a default `GraphComputer` strategy that can re-write some traversals to not require message passing. +* Added default `MessagePassingReductionStrategy` for `GraphComputer` that can reduce the number of message passing iterations. * Fixed a bug associated with user-provided maps and `GroupSideEffectStep`. * `GroupBiOperator` no longer maintains a detached traversal and thus, no more side-effect related OLAP inconsistencies. * Added `ProjectedTraverser` which wraps a traverser with a `List` of projected data. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c2a42e27/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/MessagePassingReductionStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/MessagePassingReductionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/MessagePassingReductionStrategy.java new file mode 100644 index 000..cff152e --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/MessagePassingReductionStrategy.java @@ -0,0 +1,162 @@ +/* + * 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.process.computer.traversal.strategy.optimization; + +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.TraversalVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.util.EmptyMemory; +import org.apache.tinkerpop.gremlin.process.traversal.Step; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal; +import
[41/45] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins
TINKERPOP-1612 Configure tests to allow them to pass under new plugins Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d282d0e9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d282d0e9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d282d0e9 Branch: refs/heads/TINKERPOP-1612 Commit: d282d0e9d1e5ec938fcdd0e5f46a6396fd6d1c9e Parents: 1fc5293 Author: Stephen MalletteAuthored: Wed Jan 25 06:52:10 2017 -0500 Committer: Stephen Mallette Committed: Mon Jan 30 15:16:06 2017 -0500 -- .../gremlin/groovy/engine/GremlinExecutor.java| 4 +--- .../gremlin/server/GremlinServerIntegrateTest.java| 14 +- 2 files changed, 6 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d282d0e9/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 8fdb86e..80e72fd 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable { // deprecated code around this is removed. if (!useGremlinScriptEngineManager) this.scriptEngines = createScriptEngines(); -else { +else this.scriptEngines = null; -gremlinScriptEngineManager.getEngineByName("gremlin-groovy"); -} this.suppliedExecutor = suppliedExecutor; this.suppliedScheduledExecutor = suppliedScheduledExecutor; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d282d0e9/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 88b0339..16476c3 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -43,8 +43,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -65,7 +65,6 @@ import org.junit.Test; import java.lang.reflect.Field; import java.nio.channels.ClosedChannelException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -205,6 +204,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration return settings; case "shouldUseSimpleSandbox": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); +// remove the script because it isn't used in the test but also because it's not CompileStatic ready + settings.scriptEngines.get("gremlin-groovy").plugins.remove(ScriptFileGremlinPlugin.class.getName()); break; case "shouldUseInterpreterMode": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForInterpreterMode()); @@ -213,6 +214,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForTimedInterrupt()); break; case "shouldUseBaseScript": +
[34/45] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1fc52939/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java -- diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java deleted file mode 100644 index e3a713d..000 --- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java +++ /dev/null @@ -1,121 +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.groovy.jsr223.dsl.credential; - -import org.apache.tinkerpop.gremlin.AbstractGremlinTest; -import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.FeatureRequirementSet; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.hamcrest.MatcherAssert; -import org.junit.Test; - -import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public class CredentialGraphTest extends AbstractGremlinTest { - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldCreateUser() { -final Vertex v = credentials(graph).createUser("stephen", "secret"); -assertEquals("stephen", v.value("username")); -assertEquals("user", v.label()); -assertNotEquals("secret", v.value("password")); // hashed to something -assertThat(v.value("password").toString().length(), greaterThan(0)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES) -public void shouldRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(1, credentials(graph).removeUser("stephen")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(0, credentials(graph).removeUser("stephanie")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -final Vertex stephen = credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(stephen, credentials(graph).findUser("stephen")); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -
[1/2] tinkerpop git commit: Fixed a gremlin server bug with global bindings
Repository: tinkerpop Updated Branches: refs/heads/master d18dd021a -> 1169f6168 Fixed a gremlin server bug with global bindings TraversalSources established in init scripts using the new plugin system weren't getting set to the GraphManager given the fact that the GremlinScriptEngineManager does runs the scripts when the GremlinScriptEngine is first initialized. By forcing the GremlinScriptEngine to initialize with a throw-away script the init scripts will execute. This is a bit of a hack - will consider other solutions for 3.3.0. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/956f3505 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/956f3505 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/956f3505 Branch: refs/heads/master Commit: 956f35056a967ecf1d8e74dc04bb227ba4823047 Parents: d08a68f Author: Stephen MalletteAuthored: Wed Jan 25 09:24:49 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 09:24:49 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/956f3505/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java index 2b2f1f1..199c9f8 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java @@ -145,6 +145,12 @@ public class ServerGremlinExecutor { logger.info("Initialized GremlinExecutor and configured ScriptEngines."); +// force each scriptengine to process something so that the init scripts will fire (this is necessary if +// the GremlinExecutor is using the GremlinScriptEngineManager. this is a bit of hack, but it at least allows +// the global bindings to become available after the init scripts are run (DefaultGremlinScriptEngineManager +// runs the init scripts when the GremlinScriptEngine is created. +settings.scriptEngines.keySet().forEach(engineName -> gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join()); + // script engine init may have altered the graph bindings or maybe even created new ones - need to // re-apply those references back gremlinExecutor.getGlobalBindings().entrySet().stream()
tinkerpop git commit: Fixed a gremlin server bug with global bindings
Repository: tinkerpop Updated Branches: refs/heads/tp32 d08a68f32 -> 956f35056 Fixed a gremlin server bug with global bindings TraversalSources established in init scripts using the new plugin system weren't getting set to the GraphManager given the fact that the GremlinScriptEngineManager does runs the scripts when the GremlinScriptEngine is first initialized. By forcing the GremlinScriptEngine to initialize with a throw-away script the init scripts will execute. This is a bit of a hack - will consider other solutions for 3.3.0. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/956f3505 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/956f3505 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/956f3505 Branch: refs/heads/tp32 Commit: 956f35056a967ecf1d8e74dc04bb227ba4823047 Parents: d08a68f Author: Stephen MalletteAuthored: Wed Jan 25 09:24:49 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 09:24:49 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/956f3505/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java index 2b2f1f1..199c9f8 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java @@ -145,6 +145,12 @@ public class ServerGremlinExecutor { logger.info("Initialized GremlinExecutor and configured ScriptEngines."); +// force each scriptengine to process something so that the init scripts will fire (this is necessary if +// the GremlinExecutor is using the GremlinScriptEngineManager. this is a bit of hack, but it at least allows +// the global bindings to become available after the init scripts are run (DefaultGremlinScriptEngineManager +// runs the init scripts when the GremlinScriptEngine is created. +settings.scriptEngines.keySet().forEach(engineName -> gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join()); + // script engine init may have altered the graph bindings or maybe even created new ones - need to // re-apply those references back gremlinExecutor.getGlobalBindings().entrySet().stream()
[2/2] 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/1169f616 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1169f616 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1169f616 Branch: refs/heads/master Commit: 1169f61680f0e0e40d227ca7d818c83eb8341e22 Parents: d18dd02 956f350 Author: Stephen MalletteAuthored: Wed Jan 25 09:28:30 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 09:28:30 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 6 ++ 1 file changed, 6 insertions(+) --
[2/2] 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/46a68f9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/46a68f9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/46a68f9b Branch: refs/heads/master Commit: 46a68f9b7f9eceed8ae10e50d23cfecfe418f4b2 Parents: 1169f61 28dffda Author: Stephen MalletteAuthored: Wed Jan 25 13:22:02 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:22:02 2017 -0500 -- .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --
[01/12] tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1612 54133ad23 -> 5e90ed307 (forced update) Had to trap an exception better in ServerGremlinExecutor during init CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47e5ae2f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47e5ae2f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47e5ae2f Branch: refs/heads/TINKERPOP-1612 Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b Parents: 28dffda Author: Stephen MalletteAuthored: Wed Jan 25 16:39:38 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:39:38 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java index 199c9f8..b9b7280 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java @@ -149,7 +149,13 @@ public class ServerGremlinExecutor { // the GremlinExecutor is using the GremlinScriptEngineManager. this is a bit of hack, but it at least allows // the global bindings to become available after the init scripts are run (DefaultGremlinScriptEngineManager // runs the init scripts when the GremlinScriptEngine is created. -settings.scriptEngines.keySet().forEach(engineName -> gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join()); +settings.scriptEngines.keySet().forEach(engineName -> { +try { +gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join(); +} catch (Exception ex) { +logger.warn(String.format("Could not initialize {} ScriptEngine as script could not be evaluated - %s", engineName), ex); +} +}); // script engine init may have altered the graph bindings or maybe even created new ones - need to // re-apply those references back
[05/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java new file mode 100644 index 000..84542e1 --- /dev/null +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java @@ -0,0 +1,406 @@ +/* + * 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.groovy.jsr223; + +import groovy.lang.MissingPropertyException; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration; +import org.junit.Assert; +import org.junit.Test; + +import javax.script.Bindings; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.concurrent.CountDownLatch; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class GremlinGroovyScriptEngineOverGraphTest { + +@Test +public void shouldDoSomeGremlin() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engine = new GremlinGroovyScriptEngine(); +final List list = new ArrayList(); +final Bindings bindings = engine.createBindings(); +bindings.put("g", g); +bindings.put("marko", convertToVertexId(graph, "marko")); +bindings.put("temp", list); +assertEquals(list.size(), 0); +engine.eval("g.V(marko).out().fill(temp)",bindings); +assertEquals(list.size(), 3); +} + +@Test +public void shouldLoadImports() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engineNoImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); +try { +engineNoImports.eval("Vertex.class.getName()"); +fail("Should have thrown an exception because no imports were supplied"); +} catch (Exception se) { +assertTrue(se instanceof ScriptException); +} + +final ScriptEngine engineWithImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) new DefaultImportCustomizerProvider()); +engineWithImports.put("g", g); +assertEquals(Vertex.class.getName(), engineWithImports.eval("Vertex.class.getName()")); +assertEquals(2l, engineWithImports.eval("g.V().has('age',gt(30)).count().next()")); +assertEquals(Direction.IN,
[09/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy deleted file mode 100644 index e1206df..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy +++ /dev/null @@ -1,43 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySimplePathTest { - -public static class Traversals extends SimplePathTest { - -@Override -public Traversalget_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id); -} - -@Override -public Traversal get_g_V_repeatXboth_simplePathX_timesX3X_path() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both.simplePath).times(3).path()"); -} -} -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy deleted file mode 100644 index 38c2a1d..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy +++ /dev/null @@ -1,92 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyTailTest { - -public static class Traversals extends TailTest { - -@Override -public Traversal get_g_V_valuesXnameX_order_tailXglobal_2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(global, 2)") -} - -@Override -public Traversal get_g_V_valuesXnameX_order_tailX2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(2)") -} - -@Override -public
[03/12] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins
TINKERPOP-1612 Configure tests to allow them to pass under new plugins Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0e80defa Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0e80defa Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0e80defa Branch: refs/heads/TINKERPOP-1612 Commit: 0e80defa0f713f93660e10e791dd5d7859204efa Parents: 6b1eef5 Author: Stephen MalletteAuthored: Wed Jan 25 06:52:10 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:40:39 2017 -0500 -- .../gremlin/groovy/engine/GremlinExecutor.java | 4 +--- .../gremlin/server/GremlinServerIntegrateTest.java | 16 +--- 2 files changed, 6 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e80defa/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 8fdb86e..80e72fd 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable { // deprecated code around this is removed. if (!useGremlinScriptEngineManager) this.scriptEngines = createScriptEngines(); -else { +else this.scriptEngines = null; -gremlinScriptEngineManager.getEngineByName("gremlin-groovy"); -} this.suppliedExecutor = suppliedExecutor; this.suppliedScheduledExecutor = suppliedScheduledExecutor; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e80defa/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 3792022..766ebf3 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -64,7 +64,6 @@ import org.junit.Test; import java.lang.reflect.Field; import java.nio.channels.ClosedChannelException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeThat; import static org.junit.Assert.assertEquals; /** @@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration return settings; case "shouldUseSimpleSandbox": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); +// remove the script because it isn't used in the test but also because it's not CompileStatic ready +
[08/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyOrderTest { - -public static class Traversals extends OrderTest { - -@Override -public Traversalget_g_V_name_order() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") -} - -@Override -public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") -} - -@Override -public Traversal get_g_V_order_byXname_incrX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") -} - -@Override -public Traversal get_g_V_order_byXnameX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") -} - -@Override -public Traversal get_g_V_outE_order_byXweight_decrX_weight() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") -} - -@Override -public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") -} - -@Override -public Traversal > get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") -} - -@Override -public Traversal > get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { -final Map map = [:]; -map[1] = it.age; -map[2] = it.age * 2; -map[3] = it.age * 3; -map[4] = it.age; -return map; -}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) -} - -@Override -public Traversal get_g_V_order_byXoutE_count__decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") -} - -@Override -public Traversal > get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") -} - -@Override -public Traversal get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") -} - -@Override -public Traversal >
[04/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-server/conf/gremlin-server-modern-readonly.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml index d4ff8d4..7750ad3 100644 --- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml +++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern-readonly.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-server/conf/gremlin-server-modern.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml index 08096f6..5d0a67d 100644 --- a/gremlin-server/conf/gremlin-server-modern.yaml +++ b/gremlin-server/conf/gremlin-server-modern.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-server/conf/gremlin-server-neo4j.yaml -- diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml index 1d4003e..0ca8b9c 100644 --- a/gremlin-server/conf/gremlin-server-neo4j.yaml +++ b/gremlin-server/conf/gremlin-server-neo4j.yaml @@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/neo4j-empty.properties} -plugins: - - tinkerpop.neo4j scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/empty-sample.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-server/conf/gremlin-server-rest-modern.yaml -- diff --git
[10/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6b1eef57 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6b1eef57 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6b1eef57 Branch: refs/heads/TINKERPOP-1612 Commit: 6b1eef57c83a63ce591ec5cd6150c7573c52e349 Parents: 0427370 Author: Stephen MalletteAuthored: Tue Jan 24 07:22:07 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:40:39 2017 -0500 -- gremlin-groovy-test/pom.xml | 64 --- .../groovy/loaders/SugarLoaderTest.groovy | 134 -- .../gremlin/groovy/util/SugarTestHelper.groovy | 37 -- .../step/branch/GroovyBranchTest.groovy | 58 --- .../step/branch/GroovyChooseTest.groovy | 62 --- .../step/branch/GroovyLocalTest.groovy | 91 - .../step/branch/GroovyOptionalTest.groovy | 59 --- .../step/branch/GroovyRepeatTest.groovy | 88 .../step/branch/GroovyUnionTest.groovy | 77 .../traversal/step/filter/GroovyAndTest.groovy | 52 --- .../traversal/step/filter/GroovyCoinTest.groovy | 41 -- .../step/filter/GroovyCyclicPathTest.groovy | 43 -- .../step/filter/GroovyDedupTest.groovy | 113 -- .../traversal/step/filter/GroovyDropTest.groovy | 51 --- .../step/filter/GroovyFilterTest.groovy | 73 .../traversal/step/filter/GroovyHasTest.groovy | 173 .../traversal/step/filter/GroovyIsTest.groovy | 57 --- .../traversal/step/filter/GroovyOrTest.groovy | 47 --- .../step/filter/GroovyRangeTest.groovy | 127 -- .../step/filter/GroovySampleTest.groovy | 58 --- .../step/filter/GroovySimplePathTest.groovy | 43 -- .../traversal/step/filter/GroovyTailTest.groovy | 92 - .../step/filter/GroovyWhereTest.groovy | 167 .../traversal/step/map/GroovyAddEdgeTest.groovy | 85 .../step/map/GroovyAddVertexTest.groovy | 101 - .../step/map/GroovyCoalesceTest.groovy | 59 --- .../step/map/GroovyConstantTest.groovy | 42 -- .../traversal/step/map/GroovyCountTest.groovy | 71 .../traversal/step/map/GroovyFlatMapTest.groovy | 36 -- .../traversal/step/map/GroovyFoldTest.groovy| 46 --- .../traversal/step/map/GroovyGraphTest.groovy | 55 --- .../traversal/step/map/GroovyLoopsTest.groovy | 56 --- .../traversal/step/map/GroovyMapKeysTest.groovy | 43 -- .../traversal/step/map/GroovyMapTest.groovy | 62 --- .../step/map/GroovyMapValuesTest.groovy | 48 --- .../traversal/step/map/GroovyMatchTest.groovy | 381 - .../traversal/step/map/GroovyMaxTest.groovy | 47 --- .../traversal/step/map/GroovyMeanTest.groovy| 42 -- .../traversal/step/map/GroovyMinTest.groovy | 47 --- .../traversal/step/map/GroovyOrderTest.groovy | 140 --- .../step/map/GroovyPageRankTest.groovy | 78 .../traversal/step/map/GroovyPathTest.groovy| 63 --- .../step/map/GroovyPeerPressureTest.groovy | 48 --- .../traversal/step/map/GroovyProfileTest.groovy | 94 - .../traversal/step/map/GroovyProgramTest.groovy | 50 --- .../traversal/step/map/GroovyProjectTest.groovy | 42 -- .../step/map/GroovyPropertiesTest.groovy| 60 --- .../traversal/step/map/GroovySelectTest.groovy | 242 --- .../traversal/step/map/GroovySumTest.groovy | 42 -- .../traversal/step/map/GroovyUnfoldTest.groovy | 48 --- .../step/map/GroovyValueMapTest.groovy | 51 --- .../traversal/step/map/GroovyVertexTest.groovy | 187 - .../step/sideEffect/GroovyAggregateTest.groovy | 53 --- .../step/sideEffect/GroovyExplainTest.groovy| 35 -- .../step/sideEffect/GroovyGroupCountTest.groovy | 101 - .../step/sideEffect/GroovyGroupTest.groovy | 137 --- .../step/sideEffect/GroovyGroupTestV3d0.groovy | 74 .../step/sideEffect/GroovyInjectTest.groovy | 42 -- .../step/sideEffect/GroovySackTest.groovy | 84 .../sideEffect/GroovySideEffectCapTest.groovy | 45 -- .../step/sideEffect/GroovySideEffectTest.groovy | 83 .../step/sideEffect/GroovyStoreTest.groovy | 53 --- .../step/sideEffect/GroovySubgraphTest.groovy | 50 --- .../step/sideEffect/GroovyTreeTest.groovy | 69 .../groovy/GroovyEnvironmentIntegrateSuite.java | 85 .../gremlin/groovy/GroovyEnvironmentSuite.java | 92 - .../engine/GremlinExecutorOverGraphTest.java| 108 - ...remlinGroovyScriptEngineFileSandboxTest.java | 120 -- .../GremlinGroovyScriptEngineIntegrateTest.java | 88 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 - ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
[11/12] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.
TINKERPOP-1612 Reconfigure some tests for new plugins. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a1b29150 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a1b29150 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a1b29150 Branch: refs/heads/TINKERPOP-1612 Commit: a1b291504d5a6ba6754f6ce581037adcc108b28f Parents: 0e80def Author: Stephen MalletteAuthored: Wed Jan 25 12:34:09 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:40:39 2017 -0500 -- .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +-- .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 7 +-- .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 - .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 - 4 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1b29150/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml -- diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml index c846cf4..3f23946 100644 --- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml +++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml @@ -32,10 +32,9 @@ graphs: { graph: src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties} scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}}, gremlin-jython: {}, gremlin-python: {} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1b29150/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java index a8164b5..658244d 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java @@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode; import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer; import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex; @@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); -settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList(p); +final Map m = new HashMap<>(); +m.put("files", Collections.singletonList(p)); + settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(), m); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration final Cluster cluster = TestClientFactory.build().serializer(serializer).create(); final Client client = cluster.connect(); -
[07/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy deleted file mode 100644 index a478f6f..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy +++ /dev/null @@ -1,84 +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.process.traversal.step.sideEffect - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySackTest { - -public static class Traversals extends SackTest { - -@Override -public Traversalget_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack('hello').V.outE.sack(assign).by(label).inV.sack") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack") -} - -@Override -public Traversal get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()") -} - -@Override -public Traversal get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1, sum).V.out.barrier.sack") -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1.0d, sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -Traversal get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(BigInteger.TEN.pow(1000), assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack") -}
[12/12] tinkerpop git commit: TINKERPOP-1612 Fixed cut/paste error in server configuration
TINKERPOP-1612 Fixed cut/paste error in server configuration Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5e90ed30 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5e90ed30 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5e90ed30 Branch: refs/heads/TINKERPOP-1612 Commit: 5e90ed3079aec454c7c0752faaecb57736e20a11 Parents: a1b2915 Author: Stephen MalletteAuthored: Wed Jan 25 18:11:36 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 18:11:36 2017 -0500 -- gremlin-python/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5e90ed30/gremlin-python/pom.xml -- diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index d30ac06..62450a7 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -490,6 +490,8 @@ settings.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settings.port = 45940 +println settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files + def server = new GremlinServer(settings) server.start().join() @@ -498,7 +500,7 @@ log.info("Gremlin Server with no authentication started on port 45940") def settingsSecure = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml") settingsSecure.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties" -settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] +settingsSecure.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settingsSecure.port = 45941 settingsSecure.authentication.className = "org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator" settingsSecure.authentication.config = [credentialsDb: "${gremlin.server.dir}/conf/tinkergraph-credentials.properties"]
[02/12] 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/04273705 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/04273705 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/04273705 Branch: refs/heads/TINKERPOP-1612 Commit: 04273705c9e8fcf23c9703670709b3b9efaf5cf1 Parents: 46a68f9 47e5ae2 Author: Stephen MalletteAuthored: Wed Jan 25 16:40:07 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:40:07 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) --
[06/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b1eef57/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java -- diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java deleted file mode 100644 index e3a713d..000 --- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java +++ /dev/null @@ -1,121 +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.groovy.jsr223.dsl.credential; - -import org.apache.tinkerpop.gremlin.AbstractGremlinTest; -import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.FeatureRequirementSet; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.hamcrest.MatcherAssert; -import org.junit.Test; - -import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public class CredentialGraphTest extends AbstractGremlinTest { - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldCreateUser() { -final Vertex v = credentials(graph).createUser("stephen", "secret"); -assertEquals("stephen", v.value("username")); -assertEquals("user", v.label()); -assertNotEquals("secret", v.value("password")); // hashed to something -assertThat(v.value("password").toString().length(), greaterThan(0)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES) -public void shouldRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(1, credentials(graph).removeUser("stephen")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(0, credentials(graph).removeUser("stephanie")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -final Vertex stephen = credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(stephen, credentials(graph).findUser("stephen")); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -
tinkerpop git commit: TINKERPOP-1610 Deprecated Groovy test suites
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1610 [created] 168d5b37e TINKERPOP-1610 Deprecated Groovy test suites Graph Providers no longer need to implement these going forward. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/168d5b37 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/168d5b37 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/168d5b37 Branch: refs/heads/TINKERPOP-1610 Commit: 168d5b37e97b15afc1c9c599035f879e92d6c1c1 Parents: 97cc07d Author: Stephen MalletteAuthored: Fri Jan 20 14:59:25 2017 -0500 Committer: Stephen Mallette Committed: Fri Jan 20 14:59:25 2017 -0500 -- CHANGELOG.asciidoc | 1 + .../upgrade/release-3.2.x-incubating.asciidoc | 17 +++-- .../tinkerpop/gremlin/structure/Graph.java | 20 .../groovy/GroovyEnvironmentIntegrateSuite.java | 2 ++ .../gremlin/groovy/GroovyEnvironmentSuite.java | 2 ++ .../process/GroovyProcessComputerSuite.java | 2 ++ .../process/GroovyProcessStandardSuite.java | 2 ++ 7 files changed, 44 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/168d5b37/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4f3f9ce..21486e9 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,7 @@ TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ * SASL negotiation supports both a byte array and Base64 encoded bytes as a string for authentication to Gremlin Server. +* Deprecated all test suites in `gremlin-groovy-test` - Graph Providers no longer need to implement these. * Deprecated `TinkerIoRegistry` replacing it with the more consistently named `TinkerIoRegistryV1d0`. * Made error messaging more consistent during result iteration timeouts in Gremlin Server. * `PathRetractionStrategy` does not add a `NoOpBarrierStep` to the end of local children as its wasted computation in 99% of traversals. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/168d5b37/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 b478b96..7b5d638 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -199,8 +199,8 @@ multi-properties have more flexibility in describing their graph capabilities. See: link:https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919] -Deprecated Performance OptIn - +Deprecated OptIn + In 3.2.1, all `junit-benchmark` performance tests were deprecated. At that time, the `OptIn` representations of these tests should have been deprecated as well, but they were not. That omission has been remedied now. Specifically, the @@ -210,6 +210,19 @@ following fields were deprecated: * `OptIn.SUITE_PROCESS_PERFORMANCE` * `OptIn.SUITE_STRUCTURE_PERFORMANCE` +As of 3.2.4, the following test suites were also deprecated: + +* `OptIn.SUITE_GROOVY_PROCESS_STANDARD` +* `OptIn.SUITE_GROOVY_PROCESS_COMPUTER` +* `OptIn.SUITE_GROOVY_ENVIRONMENT` +* `OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE` + +Future testing of `gremlin-groovy` (and language variants in general) will be handled differently and will not require +a Graph Provider to validate its operations with it. Graph Providers may now choose to remove these tests from their +test suites, which should reduce the testing burden. + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1610[TINKERPOP-1610] + Deprecated getInstance() http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/168d5b37/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java index 255fbca..1027e9b 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java @@ -1226,9 +1226,29 @@ public interface Graph extends AutoCloseable, Host { */ @Deprecated public static String SUITE_PROCESS_PERFORMANCE = "org.apache.tinkerpop.gremlin.process.ProcessPerformanceSuite"; + +/** + * @deprecated As
[02/15] 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/7b3adca3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7b3adca3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7b3adca3 Branch: refs/heads/TINKERPOP-1612-wip Commit: 7b3adca394a765f18010d98a5420ada36c155a61 Parents: f242289 c958b22 Author: Stephen MalletteAuthored: Thu Jan 26 14:47:20 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:47:20 2017 -0500 -- .../gremlin/jsr223/BindingsCustomizer.java | 11 ++- .../gremlin/jsr223/BindingsGremlinPlugin.java | 48 -- .../jsr223/DefaultBindingsCustomizer.java | 20 - .../DefaultGremlinScriptEngineManager.java | 16 +++- .../gremlin/jsr223/LazyBindingsCustomizer.java | 20 + .../gremlin/jsr223/ScriptFileGremlinPlugin.java | 4 +- .../jsr223/BindingsScriptEngineTest.java| 95 .../jsr223/GremlinScriptEngineSuite.java| 1 + 8 files changed, 206 insertions(+), 9 deletions(-) --
[12/15] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.
TINKERPOP-1612 Reconfigure some tests for new plugins. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f40c0287 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f40c0287 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f40c0287 Branch: refs/heads/TINKERPOP-1612-wip Commit: f40c02876fe1e01d5db5f22600ee6b399648d574 Parents: 2bfe41f Author: Stephen MalletteAuthored: Wed Jan 25 12:34:09 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +-- .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 7 +-- .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 - .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 - 4 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f40c0287/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml -- diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml index c846cf4..3f23946 100644 --- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml +++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml @@ -32,10 +32,9 @@ graphs: { graph: src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties} scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}}, gremlin-jython: {}, gremlin-python: {} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f40c0287/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java index a8164b5..658244d 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java @@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode; import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer; import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex; @@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); -settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList(p); +final Map m = new HashMap<>(); +m.put("files", Collections.singletonList(p)); + settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(), m); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration final Cluster cluster = TestClientFactory.build().serializer(serializer).create(); final Client client = cluster.connect(); -
[09/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a5f528a5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a5f528a5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a5f528a5 Branch: refs/heads/TINKERPOP-1612-wip Commit: a5f528a5bfb116c95add2a6e93f17745700f5abe Parents: 7b3adca Author: Stephen MalletteAuthored: Tue Jan 24 07:22:07 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:44 2017 -0500 -- gremlin-groovy-test/pom.xml | 64 --- .../groovy/loaders/SugarLoaderTest.groovy | 134 -- .../gremlin/groovy/util/SugarTestHelper.groovy | 37 -- .../step/branch/GroovyBranchTest.groovy | 58 --- .../step/branch/GroovyChooseTest.groovy | 62 --- .../step/branch/GroovyLocalTest.groovy | 91 - .../step/branch/GroovyOptionalTest.groovy | 59 --- .../step/branch/GroovyRepeatTest.groovy | 88 .../step/branch/GroovyUnionTest.groovy | 77 .../traversal/step/filter/GroovyAndTest.groovy | 52 --- .../traversal/step/filter/GroovyCoinTest.groovy | 41 -- .../step/filter/GroovyCyclicPathTest.groovy | 43 -- .../step/filter/GroovyDedupTest.groovy | 113 -- .../traversal/step/filter/GroovyDropTest.groovy | 51 --- .../step/filter/GroovyFilterTest.groovy | 73 .../traversal/step/filter/GroovyHasTest.groovy | 173 .../traversal/step/filter/GroovyIsTest.groovy | 57 --- .../traversal/step/filter/GroovyOrTest.groovy | 47 --- .../step/filter/GroovyRangeTest.groovy | 127 -- .../step/filter/GroovySampleTest.groovy | 58 --- .../step/filter/GroovySimplePathTest.groovy | 43 -- .../traversal/step/filter/GroovyTailTest.groovy | 92 - .../step/filter/GroovyWhereTest.groovy | 167 .../traversal/step/map/GroovyAddEdgeTest.groovy | 85 .../step/map/GroovyAddVertexTest.groovy | 101 - .../step/map/GroovyCoalesceTest.groovy | 59 --- .../step/map/GroovyConstantTest.groovy | 42 -- .../traversal/step/map/GroovyCountTest.groovy | 71 .../traversal/step/map/GroovyFlatMapTest.groovy | 36 -- .../traversal/step/map/GroovyFoldTest.groovy| 46 --- .../traversal/step/map/GroovyGraphTest.groovy | 55 --- .../traversal/step/map/GroovyLoopsTest.groovy | 56 --- .../traversal/step/map/GroovyMapKeysTest.groovy | 43 -- .../traversal/step/map/GroovyMapTest.groovy | 62 --- .../step/map/GroovyMapValuesTest.groovy | 48 --- .../traversal/step/map/GroovyMatchTest.groovy | 381 - .../traversal/step/map/GroovyMaxTest.groovy | 47 --- .../traversal/step/map/GroovyMeanTest.groovy| 42 -- .../traversal/step/map/GroovyMinTest.groovy | 47 --- .../traversal/step/map/GroovyOrderTest.groovy | 140 --- .../step/map/GroovyPageRankTest.groovy | 78 .../traversal/step/map/GroovyPathTest.groovy| 63 --- .../step/map/GroovyPeerPressureTest.groovy | 48 --- .../traversal/step/map/GroovyProfileTest.groovy | 94 - .../traversal/step/map/GroovyProgramTest.groovy | 50 --- .../traversal/step/map/GroovyProjectTest.groovy | 42 -- .../step/map/GroovyPropertiesTest.groovy| 60 --- .../traversal/step/map/GroovySelectTest.groovy | 242 --- .../traversal/step/map/GroovySumTest.groovy | 42 -- .../traversal/step/map/GroovyUnfoldTest.groovy | 48 --- .../step/map/GroovyValueMapTest.groovy | 51 --- .../traversal/step/map/GroovyVertexTest.groovy | 187 - .../step/sideEffect/GroovyAggregateTest.groovy | 53 --- .../step/sideEffect/GroovyExplainTest.groovy| 35 -- .../step/sideEffect/GroovyGroupCountTest.groovy | 101 - .../step/sideEffect/GroovyGroupTest.groovy | 137 --- .../step/sideEffect/GroovyGroupTestV3d0.groovy | 74 .../step/sideEffect/GroovyInjectTest.groovy | 42 -- .../step/sideEffect/GroovySackTest.groovy | 84 .../sideEffect/GroovySideEffectCapTest.groovy | 45 -- .../step/sideEffect/GroovySideEffectTest.groovy | 83 .../step/sideEffect/GroovyStoreTest.groovy | 53 --- .../step/sideEffect/GroovySubgraphTest.groovy | 50 --- .../step/sideEffect/GroovyTreeTest.groovy | 69 .../groovy/GroovyEnvironmentIntegrateSuite.java | 85 .../gremlin/groovy/GroovyEnvironmentSuite.java | 92 - .../engine/GremlinExecutorOverGraphTest.java| 108 - ...remlinGroovyScriptEngineFileSandboxTest.java | 120 -- .../GremlinGroovyScriptEngineIntegrateTest.java | 88 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 - ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
[07/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyOrderTest { - -public static class Traversals extends OrderTest { - -@Override -public Traversalget_g_V_name_order() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") -} - -@Override -public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") -} - -@Override -public Traversal get_g_V_order_byXname_incrX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") -} - -@Override -public Traversal get_g_V_order_byXnameX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") -} - -@Override -public Traversal get_g_V_outE_order_byXweight_decrX_weight() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") -} - -@Override -public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") -} - -@Override -public Traversal > get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") -} - -@Override -public Traversal > get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { -final Map map = [:]; -map[1] = it.age; -map[2] = it.age * 2; -map[3] = it.age * 3; -map[4] = it.age; -return map; -}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) -} - -@Override -public Traversal get_g_V_order_byXoutE_count__decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") -} - -@Override -public Traversal > get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") -} - -@Override -public Traversal get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") -} - -@Override -public Traversal >
[14/15] tinkerpop git commit: TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff
TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cbf38b6d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cbf38b6d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cbf38b6d Branch: refs/heads/TINKERPOP-1612-wip Commit: cbf38b6dca0744ad363306a9456bbd1fbbf25af3 Parents: 4b5e941 Author: Stephen MalletteAuthored: Thu Jan 26 10:21:10 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:56:18 2017 -0500 -- giraph-gremlin/pom.xml | 11 - .../groovy/plugin/GiraphGremlinPlugin.java | 65 --- ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - ...GraphComputerGroovyProcessIntegrateTest.java | 33 -- .../src/test/resources/gremlin-server.yaml | 8 +- .../gremlin/groovy/util/SugarTestHelper.groovy | 1 - .../groovy/plugin/HadoopGremlinPlugin.java | 104 - .../groovy/plugin/HadoopRemoteAcceptor.java | 122 -- .../gremlin/hadoop/structure/HadoopGraph.java | 103 - .../structure/io/script/ScriptRecordWriter.java | 11 +- ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - .../gremlin/hadoop/HadoopGraphProvider.java | 5 +- .../gremlin/hadoop/HadoopGremlinSuite.java | 2 +- .../groovy/plugin/HadoopGremlinPluginCheck.java | 395 -- .../hadoop/jsr223/HadoopGremlinPluginCheck.java | 397 +++ .../HadoopGraphGroovyProcessStandardTest.java | 33 -- pom.xml | 2 +- spark-gremlin/pom.xml | 11 - .../spark/groovy/plugin/SparkGremlinPlugin.java | 74 ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - .../computer/SparkHadoopGraphProvider.java | 16 +- ...GraphComputerGroovyProcessIntegrateTest.java | 33 -- .../gremlin/spark/util/SugarTestHelper.java | 56 +++ 23 files changed, 469 insertions(+), 1016 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/giraph-gremlin/pom.xml -- diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml index 9a21f36..8f2ee83 100644 --- a/giraph-gremlin/pom.xml +++ b/giraph-gremlin/pom.xml @@ -43,11 +43,6 @@ limitations under the License. org.apache.tinkerpop -gremlin-groovy -${project.version} - - -org.apache.tinkerpop hadoop-gremlin ${project.version} @@ -165,12 +160,6 @@ limitations under the License. org.apache.tinkerpop -gremlin-groovy-test -${project.version} -test - - -org.apache.tinkerpop tinkergraph-gremlin ${project.version} test http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java -- diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java deleted file mode 100644 index 80d98f9..000 --- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java +++ /dev/null @@ -1,65 +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.giraph.groovy.plugin; - -import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer; -import org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.plugin.IllegalEnvironmentException; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; -import
[01/15] tinkerpop git commit: Made some improvements to the BindingsGremlinPlugin [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1612-wip 4410f70df -> eaedc39de (forced update) Made some improvements to the BindingsGremlinPlugin Made it possible to specify scopes to apply the bindings to. Added tests. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c958b220 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c958b220 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c958b220 Branch: refs/heads/TINKERPOP-1612-wip Commit: c958b220b9559bb5fedbcc6e5c17f2dc142fb430 Parents: 91759a5 Author: Stephen MalletteAuthored: Thu Jan 26 14:46:36 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:46:36 2017 -0500 -- .../gremlin/jsr223/BindingsCustomizer.java | 11 ++- .../gremlin/jsr223/BindingsGremlinPlugin.java | 48 -- .../jsr223/DefaultBindingsCustomizer.java | 20 - .../DefaultGremlinScriptEngineManager.java | 16 +++- .../gremlin/jsr223/LazyBindingsCustomizer.java | 20 + .../gremlin/jsr223/ScriptFileGremlinPlugin.java | 4 +- .../jsr223/BindingsScriptEngineTest.java| 95 .../jsr223/GremlinScriptEngineSuite.java| 1 + 8 files changed, 206 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c958b220/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java index 02c129e..e8dd9f3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java @@ -21,7 +21,9 @@ package org.apache.tinkerpop.gremlin.jsr223; import javax.script.Bindings; /** - * Provides a way to alter the bindings on a {@link GremlinScriptEngine}. + * Provides a way to alter the bindings on a {@link GremlinScriptEngine}. Those implementing {@link GremlinScriptEngine} + * instances need to be concerned with accounting for this {@link Customizer}. It is handled automatically by the + * {@link DefaultGremlinScriptEngineManager}. * * @author Stephen Mallette (http://stephen.genoprime.com) */ @@ -30,4 +32,11 @@ public interface BindingsCustomizer extends Customizer { * Gets the bindings to add to a {@link GremlinScriptEngine}. */ public Bindings getBindings(); + +/** + * Gets the scope to which the bindings apply. The scope is determined by the {@code ScriptContext} values where + * "100" is {@code EngineScope} (bindings apply to the current {@link GremlinScriptEngine}) and "200" is + * {@code GlobalScope} (bindings apply to the engines created by the current {@link GremlinScriptEngineManager}. + */ +public int getScope(); } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c958b220/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java index feb501d..59304df 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java @@ -19,26 +19,48 @@ package org.apache.tinkerpop.gremlin.jsr223; import javax.script.Bindings; +import javax.script.ScriptContext; import javax.script.SimpleBindings; +import java.util.Collection; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.function.Supplier; /** + * A module that allows {@code Bindings} to be applied to a {@link GremlinScriptEngine}. The bindings are controled by + * their {@code scope} which are determined by the {@code ScriptContext} values where "100" is {@code ENGINE_SCOPE} + * (bindings apply to the current {@link GremlinScriptEngine}) and "200" is {@code GLOBAL_SCOPE} (bindings apply to the + * engines created by the current {@link GremlinScriptEngineManager}. + * + * Note that bindings are applied in the following order: + * + * The order in which the {@link GremlinScriptEngine} is requested from the {@link GremlinScriptEngineManager} + * The order in which the {@code BindingsGremlinPlugin} instances are added to the {@link GremlinScriptEngineManager} + * + * + * Moreover, they will override one
[11/15] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins
TINKERPOP-1612 Configure tests to allow them to pass under new plugins Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2bfe41f4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2bfe41f4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2bfe41f4 Branch: refs/heads/TINKERPOP-1612-wip Commit: 2bfe41f4cfbfaf7280ca68d6420c394f968a4975 Parents: a5f528a Author: Stephen MalletteAuthored: Wed Jan 25 06:52:10 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- .../gremlin/groovy/engine/GremlinExecutor.java | 4 +--- .../gremlin/server/GremlinServerIntegrateTest.java | 16 +--- 2 files changed, 6 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2bfe41f4/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 8fdb86e..80e72fd 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable { // deprecated code around this is removed. if (!useGremlinScriptEngineManager) this.scriptEngines = createScriptEngines(); -else { +else this.scriptEngines = null; -gremlinScriptEngineManager.getEngineByName("gremlin-groovy"); -} this.suppliedExecutor = suppliedExecutor; this.suppliedScheduledExecutor = suppliedScheduledExecutor; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2bfe41f4/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 3792022..766ebf3 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -64,7 +64,6 @@ import org.junit.Test; import java.lang.reflect.Field; import java.nio.channels.ClosedChannelException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeThat; import static org.junit.Assert.assertEquals; /** @@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration return settings; case "shouldUseSimpleSandbox": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); +// remove the script because it isn't used in the test but also because it's not CompileStatic ready +
[05/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java -- diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java deleted file mode 100644 index e3a713d..000 --- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java +++ /dev/null @@ -1,121 +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.groovy.jsr223.dsl.credential; - -import org.apache.tinkerpop.gremlin.AbstractGremlinTest; -import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.FeatureRequirementSet; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.hamcrest.MatcherAssert; -import org.junit.Test; - -import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public class CredentialGraphTest extends AbstractGremlinTest { - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldCreateUser() { -final Vertex v = credentials(graph).createUser("stephen", "secret"); -assertEquals("stephen", v.value("username")); -assertEquals("user", v.label()); -assertNotEquals("secret", v.value("password")); // hashed to something -assertThat(v.value("password").toString().length(), greaterThan(0)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES) -public void shouldRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(1, credentials(graph).removeUser("stephen")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(0, credentials(graph).removeUser("stephanie")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -final Vertex stephen = credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(stephen, credentials(graph).findUser("stephen")); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -
[05/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java -- diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java deleted file mode 100644 index e3a713d..000 --- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java +++ /dev/null @@ -1,121 +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.groovy.jsr223.dsl.credential; - -import org.apache.tinkerpop.gremlin.AbstractGremlinTest; -import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.FeatureRequirementSet; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.hamcrest.MatcherAssert; -import org.junit.Test; - -import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public class CredentialGraphTest extends AbstractGremlinTest { - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldCreateUser() { -final Vertex v = credentials(graph).createUser("stephen", "secret"); -assertEquals("stephen", v.value("username")); -assertEquals("user", v.label()); -assertNotEquals("secret", v.value("password")); // hashed to something -assertThat(v.value("password").toString().length(), greaterThan(0)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES) -public void shouldRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(1, credentials(graph).removeUser("stephen")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(0, credentials(graph).removeUser("stephanie")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -final Vertex stephen = credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(stephen, credentials(graph).findUser("stephen")); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -
[09/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a5f528a5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a5f528a5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a5f528a5 Branch: refs/heads/TINKERPOP-1612 Commit: a5f528a5bfb116c95add2a6e93f17745700f5abe Parents: 7b3adca Author: Stephen MalletteAuthored: Tue Jan 24 07:22:07 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:44 2017 -0500 -- gremlin-groovy-test/pom.xml | 64 --- .../groovy/loaders/SugarLoaderTest.groovy | 134 -- .../gremlin/groovy/util/SugarTestHelper.groovy | 37 -- .../step/branch/GroovyBranchTest.groovy | 58 --- .../step/branch/GroovyChooseTest.groovy | 62 --- .../step/branch/GroovyLocalTest.groovy | 91 - .../step/branch/GroovyOptionalTest.groovy | 59 --- .../step/branch/GroovyRepeatTest.groovy | 88 .../step/branch/GroovyUnionTest.groovy | 77 .../traversal/step/filter/GroovyAndTest.groovy | 52 --- .../traversal/step/filter/GroovyCoinTest.groovy | 41 -- .../step/filter/GroovyCyclicPathTest.groovy | 43 -- .../step/filter/GroovyDedupTest.groovy | 113 -- .../traversal/step/filter/GroovyDropTest.groovy | 51 --- .../step/filter/GroovyFilterTest.groovy | 73 .../traversal/step/filter/GroovyHasTest.groovy | 173 .../traversal/step/filter/GroovyIsTest.groovy | 57 --- .../traversal/step/filter/GroovyOrTest.groovy | 47 --- .../step/filter/GroovyRangeTest.groovy | 127 -- .../step/filter/GroovySampleTest.groovy | 58 --- .../step/filter/GroovySimplePathTest.groovy | 43 -- .../traversal/step/filter/GroovyTailTest.groovy | 92 - .../step/filter/GroovyWhereTest.groovy | 167 .../traversal/step/map/GroovyAddEdgeTest.groovy | 85 .../step/map/GroovyAddVertexTest.groovy | 101 - .../step/map/GroovyCoalesceTest.groovy | 59 --- .../step/map/GroovyConstantTest.groovy | 42 -- .../traversal/step/map/GroovyCountTest.groovy | 71 .../traversal/step/map/GroovyFlatMapTest.groovy | 36 -- .../traversal/step/map/GroovyFoldTest.groovy| 46 --- .../traversal/step/map/GroovyGraphTest.groovy | 55 --- .../traversal/step/map/GroovyLoopsTest.groovy | 56 --- .../traversal/step/map/GroovyMapKeysTest.groovy | 43 -- .../traversal/step/map/GroovyMapTest.groovy | 62 --- .../step/map/GroovyMapValuesTest.groovy | 48 --- .../traversal/step/map/GroovyMatchTest.groovy | 381 - .../traversal/step/map/GroovyMaxTest.groovy | 47 --- .../traversal/step/map/GroovyMeanTest.groovy| 42 -- .../traversal/step/map/GroovyMinTest.groovy | 47 --- .../traversal/step/map/GroovyOrderTest.groovy | 140 --- .../step/map/GroovyPageRankTest.groovy | 78 .../traversal/step/map/GroovyPathTest.groovy| 63 --- .../step/map/GroovyPeerPressureTest.groovy | 48 --- .../traversal/step/map/GroovyProfileTest.groovy | 94 - .../traversal/step/map/GroovyProgramTest.groovy | 50 --- .../traversal/step/map/GroovyProjectTest.groovy | 42 -- .../step/map/GroovyPropertiesTest.groovy| 60 --- .../traversal/step/map/GroovySelectTest.groovy | 242 --- .../traversal/step/map/GroovySumTest.groovy | 42 -- .../traversal/step/map/GroovyUnfoldTest.groovy | 48 --- .../step/map/GroovyValueMapTest.groovy | 51 --- .../traversal/step/map/GroovyVertexTest.groovy | 187 - .../step/sideEffect/GroovyAggregateTest.groovy | 53 --- .../step/sideEffect/GroovyExplainTest.groovy| 35 -- .../step/sideEffect/GroovyGroupCountTest.groovy | 101 - .../step/sideEffect/GroovyGroupTest.groovy | 137 --- .../step/sideEffect/GroovyGroupTestV3d0.groovy | 74 .../step/sideEffect/GroovyInjectTest.groovy | 42 -- .../step/sideEffect/GroovySackTest.groovy | 84 .../sideEffect/GroovySideEffectCapTest.groovy | 45 -- .../step/sideEffect/GroovySideEffectTest.groovy | 83 .../step/sideEffect/GroovyStoreTest.groovy | 53 --- .../step/sideEffect/GroovySubgraphTest.groovy | 50 --- .../step/sideEffect/GroovyTreeTest.groovy | 69 .../groovy/GroovyEnvironmentIntegrateSuite.java | 85 .../gremlin/groovy/GroovyEnvironmentSuite.java | 92 - .../engine/GremlinExecutorOverGraphTest.java| 108 - ...remlinGroovyScriptEngineFileSandboxTest.java | 120 -- .../GremlinGroovyScriptEngineIntegrateTest.java | 88 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 - ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
[10/12] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins
TINKERPOP-1612 Configure tests to allow them to pass under new plugins Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2bfe41f4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2bfe41f4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2bfe41f4 Branch: refs/heads/TINKERPOP-1612 Commit: 2bfe41f4cfbfaf7280ca68d6420c394f968a4975 Parents: a5f528a Author: Stephen MalletteAuthored: Wed Jan 25 06:52:10 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- .../gremlin/groovy/engine/GremlinExecutor.java | 4 +--- .../gremlin/server/GremlinServerIntegrateTest.java | 16 +--- 2 files changed, 6 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2bfe41f4/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 8fdb86e..80e72fd 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable { // deprecated code around this is removed. if (!useGremlinScriptEngineManager) this.scriptEngines = createScriptEngines(); -else { +else this.scriptEngines = null; -gremlinScriptEngineManager.getEngineByName("gremlin-groovy"); -} this.suppliedExecutor = suppliedExecutor; this.suppliedScheduledExecutor = suppliedScheduledExecutor; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2bfe41f4/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 3792022..766ebf3 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -64,7 +64,6 @@ import org.junit.Test; import java.lang.reflect.Field; import java.nio.channels.ClosedChannelException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeThat; import static org.junit.Assert.assertEquals; /** @@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration return settings; case "shouldUseSimpleSandbox": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); +// remove the script because it isn't used in the test but also because it's not CompileStatic ready +
[02/12] 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/7b3adca3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7b3adca3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7b3adca3 Branch: refs/heads/TINKERPOP-1612 Commit: 7b3adca394a765f18010d98a5420ada36c155a61 Parents: f242289 c958b22 Author: Stephen MalletteAuthored: Thu Jan 26 14:47:20 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:47:20 2017 -0500 -- .../gremlin/jsr223/BindingsCustomizer.java | 11 ++- .../gremlin/jsr223/BindingsGremlinPlugin.java | 48 -- .../jsr223/DefaultBindingsCustomizer.java | 20 - .../DefaultGremlinScriptEngineManager.java | 16 +++- .../gremlin/jsr223/LazyBindingsCustomizer.java | 20 + .../gremlin/jsr223/ScriptFileGremlinPlugin.java | 4 +- .../jsr223/BindingsScriptEngineTest.java| 95 .../jsr223/GremlinScriptEngineSuite.java| 1 + 8 files changed, 206 insertions(+), 9 deletions(-) --
[11/12] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.
TINKERPOP-1612 Reconfigure some tests for new plugins. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f40c0287 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f40c0287 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f40c0287 Branch: refs/heads/TINKERPOP-1612 Commit: f40c02876fe1e01d5db5f22600ee6b399648d574 Parents: 2bfe41f Author: Stephen MalletteAuthored: Wed Jan 25 12:34:09 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +-- .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 7 +-- .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 - .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 - 4 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f40c0287/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml -- diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml index c846cf4..3f23946 100644 --- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml +++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml @@ -32,10 +32,9 @@ graphs: { graph: src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties} scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}}, gremlin-jython: {}, gremlin-python: {} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f40c0287/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java index a8164b5..658244d 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java @@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode; import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer; import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex; @@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); -settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList(p); +final Map m = new HashMap<>(); +m.put("files", Collections.singletonList(p)); + settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(), m); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration final Cluster cluster = TestClientFactory.build().serializer(serializer).create(); final Client client = cluster.connect(); -
[13/15] tinkerpop git commit: TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin -- diff --git a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin b/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin deleted file mode 100644 index 0399720..000 --- a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin +++ /dev/null @@ -1 +0,0 @@ -org.apache.tinkerpop.gremlin.spark.groovy.plugin.SparkGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java -- diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java index 6cdcb67..74e1207 100644 --- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java +++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java @@ -22,32 +22,25 @@ import org.apache.spark.launcher.SparkLauncher; import org.apache.spark.serializer.KryoSerializer; import org.apache.tinkerpop.gremlin.GraphProvider; import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.hadoop.Constants; import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider; -import org.apache.tinkerpop.gremlin.hadoop.groovy.plugin.HadoopGremlinPluginCheck; +import org.apache.tinkerpop.gremlin.hadoop.jsr223.HadoopGremlinPluginCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorageCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools; -import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry; import org.apache.tinkerpop.gremlin.process.computer.Computer; import org.apache.tinkerpop.gremlin.process.computer.GraphComputer; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPageRankTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPeerPressureTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyProgramTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PeerPressureTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; import org.apache.tinkerpop.gremlin.spark.structure.Spark; import org.apache.tinkerpop.gremlin.spark.structure.io.PersistedOutputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorageCheck; -import org.apache.tinkerpop.gremlin.spark.structure.io.SparkIoRegistryCheck; import org.apache.tinkerpop.gremlin.spark.structure.io.ToyGraphInputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator; +import org.apache.tinkerpop.gremlin.spark.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.io.IoRegistry; -import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimService; import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader; import java.util.Map; @@ -75,11 +68,8 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { // toy graph inputRDD does not have corresponding outputRDD so where jobs chain, it fails (failing makes sense) if (null != loadGraphWith && !test.equals(ProgramTest.Traversals.class) && -!test.equals(GroovyProgramTest.Traversals.class) && !test.equals(PageRankTest.Traversals.class) && -!test.equals(GroovyPageRankTest.Traversals.class) && !test.equals(PeerPressureTest.Traversals.class) && -!test.equals(GroovyPeerPressureTest.Traversals.class) && !test.equals(FileSystemStorageCheck.class) && !testMethodName.equals("shouldSupportJobChaining") && // GraphComputerTest.shouldSupportJobChaining RANDOM.nextBoolean()) { @@ -97,7 +87,7 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { Spark.close(); HadoopPools.close();
[10/15] tinkerpop git commit: TINKERPOP-1612 Fixed cut/paste error in server configuration
TINKERPOP-1612 Fixed cut/paste error in server configuration Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4b5e9410 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4b5e9410 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4b5e9410 Branch: refs/heads/TINKERPOP-1612-wip Commit: 4b5e9410fe8667549f362a7493acbeb2bc532af1 Parents: f40c028 Author: Stephen MalletteAuthored: Wed Jan 25 18:11:36 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- gremlin-python/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4b5e9410/gremlin-python/pom.xml -- diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index d30ac06..62450a7 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -490,6 +490,8 @@ settings.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settings.port = 45940 +println settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files + def server = new GremlinServer(settings) server.start().join() @@ -498,7 +500,7 @@ log.info("Gremlin Server with no authentication started on port 45940") def settingsSecure = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml") settingsSecure.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties" -settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] +settingsSecure.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settingsSecure.port = 45941 settingsSecure.authentication.className = "org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator" settingsSecure.authentication.config = [credentialsDb: "${gremlin.server.dir}/conf/tinkergraph-credentials.properties"]
[15/15] tinkerpop git commit: TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j
TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j That used to come in as part of gremlin-groovy, but since neo4j-gremlin no longer depends on that we need to remove the exclusion. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/eaedc39d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/eaedc39d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/eaedc39d Branch: refs/heads/TINKERPOP-1612-wip Commit: eaedc39def289a22efdc44fdb9c57e24d12dc960 Parents: cbf38b6 Author: Stephen MalletteAuthored: Thu Jan 26 10:58:14 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:56:18 2017 -0500 -- neo4j-gremlin/pom.xml | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eaedc39d/neo4j-gremlin/pom.xml -- diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index cedd11e..7602cc0 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -122,10 +122,6 @@ limitations under the License. test -org.apache.commons -commons-lang3 - - com.googlecode.concurrentlinkedhashmap concurrentlinkedhashmap-lru
[03/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-modern-readonly.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml index d4ff8d4..7750ad3 100644 --- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml +++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern-readonly.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-modern.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml index 08096f6..5d0a67d 100644 --- a/gremlin-server/conf/gremlin-server-modern.yaml +++ b/gremlin-server/conf/gremlin-server-modern.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-neo4j.yaml -- diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml index 1d4003e..0ca8b9c 100644 --- a/gremlin-server/conf/gremlin-server-neo4j.yaml +++ b/gremlin-server/conf/gremlin-server-neo4j.yaml @@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/neo4j-empty.properties} -plugins: - - tinkerpop.neo4j scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/empty-sample.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-rest-modern.yaml -- diff --git
[06/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy deleted file mode 100644 index a478f6f..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy +++ /dev/null @@ -1,84 +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.process.traversal.step.sideEffect - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySackTest { - -public static class Traversals extends SackTest { - -@Override -public Traversalget_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack('hello').V.outE.sack(assign).by(label).inV.sack") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack") -} - -@Override -public Traversal get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()") -} - -@Override -public Traversal get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1, sum).V.out.barrier.sack") -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1.0d, sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -Traversal get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(BigInteger.TEN.pow(1000), assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack") -}
[12/12] tinkerpop git commit: TINKERPOP-1612 Fixed cut/paste error in server configuration
TINKERPOP-1612 Fixed cut/paste error in server configuration Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4b5e9410 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4b5e9410 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4b5e9410 Branch: refs/heads/TINKERPOP-1612 Commit: 4b5e9410fe8667549f362a7493acbeb2bc532af1 Parents: f40c028 Author: Stephen MalletteAuthored: Wed Jan 25 18:11:36 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:55:45 2017 -0500 -- gremlin-python/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4b5e9410/gremlin-python/pom.xml -- diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index d30ac06..62450a7 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -490,6 +490,8 @@ settings.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settings.port = 45940 +println settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files + def server = new GremlinServer(settings) server.start().join() @@ -498,7 +500,7 @@ log.info("Gremlin Server with no authentication started on port 45940") def settingsSecure = Settings.read("${gremlin.server.dir}/conf/gremlin-server-modern-py.yaml") settingsSecure.graphs.graph = "${gremlin.server.dir}/conf/tinkergraph-empty.properties" -settings.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] +settingsSecure.scriptEngines["gremlin-groovy"].plugins["org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin"].files = ["${gremlin.server.dir}/scripts/generate-modern.groovy"] settingsSecure.port = 45941 settingsSecure.authentication.className = "org.apache.tinkerpop.gremlin.server.auth.SimpleAuthenticator" settingsSecure.authentication.config = [credentialsDb: "${gremlin.server.dir}/conf/tinkergraph-credentials.properties"]
[04/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java new file mode 100644 index 000..84542e1 --- /dev/null +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java @@ -0,0 +1,406 @@ +/* + * 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.groovy.jsr223; + +import groovy.lang.MissingPropertyException; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration; +import org.junit.Assert; +import org.junit.Test; + +import javax.script.Bindings; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.concurrent.CountDownLatch; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class GremlinGroovyScriptEngineOverGraphTest { + +@Test +public void shouldDoSomeGremlin() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engine = new GremlinGroovyScriptEngine(); +final List list = new ArrayList(); +final Bindings bindings = engine.createBindings(); +bindings.put("g", g); +bindings.put("marko", convertToVertexId(graph, "marko")); +bindings.put("temp", list); +assertEquals(list.size(), 0); +engine.eval("g.V(marko).out().fill(temp)",bindings); +assertEquals(list.size(), 3); +} + +@Test +public void shouldLoadImports() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engineNoImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); +try { +engineNoImports.eval("Vertex.class.getName()"); +fail("Should have thrown an exception because no imports were supplied"); +} catch (Exception se) { +assertTrue(se instanceof ScriptException); +} + +final ScriptEngine engineWithImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) new DefaultImportCustomizerProvider()); +engineWithImports.put("g", g); +assertEquals(Vertex.class.getName(), engineWithImports.eval("Vertex.class.getName()")); +assertEquals(2l, engineWithImports.eval("g.V().has('age',gt(30)).count().next()")); +assertEquals(Direction.IN,
[06/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy deleted file mode 100644 index a478f6f..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy +++ /dev/null @@ -1,84 +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.process.traversal.step.sideEffect - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySackTest { - -public static class Traversals extends SackTest { - -@Override -public Traversalget_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack('hello').V.outE.sack(assign).by(label).inV.sack") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack") -} - -@Override -public Traversal get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()") -} - -@Override -public Traversal get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1, sum).V.out.barrier.sack") -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1.0d, sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -Traversal get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(BigInteger.TEN.pow(1000), assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack") -}
[03/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-modern-readonly.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml index d4ff8d4..7750ad3 100644 --- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml +++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern-readonly.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-modern.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml index 08096f6..5d0a67d 100644 --- a/gremlin-server/conf/gremlin-server-modern.yaml +++ b/gremlin-server/conf/gremlin-server-modern.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-neo4j.yaml -- diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml index 1d4003e..0ca8b9c 100644 --- a/gremlin-server/conf/gremlin-server-neo4j.yaml +++ b/gremlin-server/conf/gremlin-server-neo4j.yaml @@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/neo4j-empty.properties} -plugins: - - tinkerpop.neo4j scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/empty-sample.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-server/conf/gremlin-server-rest-modern.yaml -- diff --git
[07/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyOrderTest { - -public static class Traversals extends OrderTest { - -@Override -public Traversalget_g_V_name_order() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") -} - -@Override -public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") -} - -@Override -public Traversal get_g_V_order_byXname_incrX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") -} - -@Override -public Traversal get_g_V_order_byXnameX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") -} - -@Override -public Traversal get_g_V_outE_order_byXweight_decrX_weight() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") -} - -@Override -public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") -} - -@Override -public Traversal > get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") -} - -@Override -public Traversal > get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { -final Map map = [:]; -map[1] = it.age; -map[2] = it.age * 2; -map[3] = it.age * 3; -map[4] = it.age; -return map; -}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) -} - -@Override -public Traversal get_g_V_order_byXoutE_count__decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") -} - -@Override -public Traversal > get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") -} - -@Override -public Traversal get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") -} - -@Override -public Traversal >
[08/12] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy deleted file mode 100644 index e1206df..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy +++ /dev/null @@ -1,43 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySimplePathTest { - -public static class Traversals extends SimplePathTest { - -@Override -public Traversalget_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id); -} - -@Override -public Traversal get_g_V_repeatXboth_simplePathX_timesX3X_path() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both.simplePath).times(3).path()"); -} -} -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a5f528a5/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy deleted file mode 100644 index 38c2a1d..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy +++ /dev/null @@ -1,92 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyTailTest { - -public static class Traversals extends TailTest { - -@Override -public Traversal get_g_V_valuesXnameX_order_tailXglobal_2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(global, 2)") -} - -@Override -public Traversal get_g_V_valuesXnameX_order_tailX2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(2)") -} - -@Override -public
[01/12] tinkerpop git commit: Made some improvements to the BindingsGremlinPlugin [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1612 577cd6d52 -> 4b5e9410f (forced update) Made some improvements to the BindingsGremlinPlugin Made it possible to specify scopes to apply the bindings to. Added tests. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c958b220 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c958b220 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c958b220 Branch: refs/heads/TINKERPOP-1612 Commit: c958b220b9559bb5fedbcc6e5c17f2dc142fb430 Parents: 91759a5 Author: Stephen MalletteAuthored: Thu Jan 26 14:46:36 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:46:36 2017 -0500 -- .../gremlin/jsr223/BindingsCustomizer.java | 11 ++- .../gremlin/jsr223/BindingsGremlinPlugin.java | 48 -- .../jsr223/DefaultBindingsCustomizer.java | 20 - .../DefaultGremlinScriptEngineManager.java | 16 +++- .../gremlin/jsr223/LazyBindingsCustomizer.java | 20 + .../gremlin/jsr223/ScriptFileGremlinPlugin.java | 4 +- .../jsr223/BindingsScriptEngineTest.java| 95 .../jsr223/GremlinScriptEngineSuite.java| 1 + 8 files changed, 206 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c958b220/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java index 02c129e..e8dd9f3 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsCustomizer.java @@ -21,7 +21,9 @@ package org.apache.tinkerpop.gremlin.jsr223; import javax.script.Bindings; /** - * Provides a way to alter the bindings on a {@link GremlinScriptEngine}. + * Provides a way to alter the bindings on a {@link GremlinScriptEngine}. Those implementing {@link GremlinScriptEngine} + * instances need to be concerned with accounting for this {@link Customizer}. It is handled automatically by the + * {@link DefaultGremlinScriptEngineManager}. * * @author Stephen Mallette (http://stephen.genoprime.com) */ @@ -30,4 +32,11 @@ public interface BindingsCustomizer extends Customizer { * Gets the bindings to add to a {@link GremlinScriptEngine}. */ public Bindings getBindings(); + +/** + * Gets the scope to which the bindings apply. The scope is determined by the {@code ScriptContext} values where + * "100" is {@code EngineScope} (bindings apply to the current {@link GremlinScriptEngine}) and "200" is + * {@code GlobalScope} (bindings apply to the engines created by the current {@link GremlinScriptEngineManager}. + */ +public int getScope(); } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c958b220/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java index feb501d..59304df 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/BindingsGremlinPlugin.java @@ -19,26 +19,48 @@ package org.apache.tinkerpop.gremlin.jsr223; import javax.script.Bindings; +import javax.script.ScriptContext; import javax.script.SimpleBindings; +import java.util.Collection; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.function.Supplier; /** + * A module that allows {@code Bindings} to be applied to a {@link GremlinScriptEngine}. The bindings are controled by + * their {@code scope} which are determined by the {@code ScriptContext} values where "100" is {@code ENGINE_SCOPE} + * (bindings apply to the current {@link GremlinScriptEngine}) and "200" is {@code GLOBAL_SCOPE} (bindings apply to the + * engines created by the current {@link GremlinScriptEngineManager}. + * + * Note that bindings are applied in the following order: + * + * The order in which the {@link GremlinScriptEngine} is requested from the {@link GremlinScriptEngineManager} + * The order in which the {@code BindingsGremlinPlugin} instances are added to the {@link GremlinScriptEngineManager} + * + * + * Moreover, they will override one another
[2/3] tinkerpop git commit: TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin -- diff --git a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin b/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin deleted file mode 100644 index 0399720..000 --- a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin +++ /dev/null @@ -1 +0,0 @@ -org.apache.tinkerpop.gremlin.spark.groovy.plugin.SparkGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java -- diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java index 6cdcb67..74e1207 100644 --- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java +++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkHadoopGraphProvider.java @@ -22,32 +22,25 @@ import org.apache.spark.launcher.SparkLauncher; import org.apache.spark.serializer.KryoSerializer; import org.apache.tinkerpop.gremlin.GraphProvider; import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.hadoop.Constants; import org.apache.tinkerpop.gremlin.hadoop.HadoopGraphProvider; -import org.apache.tinkerpop.gremlin.hadoop.groovy.plugin.HadoopGremlinPluginCheck; +import org.apache.tinkerpop.gremlin.hadoop.jsr223.HadoopGremlinPluginCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorageCheck; import org.apache.tinkerpop.gremlin.hadoop.structure.io.HadoopPools; -import org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.ToyIoRegistry; import org.apache.tinkerpop.gremlin.process.computer.Computer; import org.apache.tinkerpop.gremlin.process.computer.GraphComputer; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPageRankTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPeerPressureTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyProgramTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PeerPressureTest; import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; import org.apache.tinkerpop.gremlin.spark.structure.Spark; import org.apache.tinkerpop.gremlin.spark.structure.io.PersistedOutputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorageCheck; -import org.apache.tinkerpop.gremlin.spark.structure.io.SparkIoRegistryCheck; import org.apache.tinkerpop.gremlin.spark.structure.io.ToyGraphInputRDD; import org.apache.tinkerpop.gremlin.spark.structure.io.gryo.GryoRegistrator; +import org.apache.tinkerpop.gremlin.spark.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.io.IoRegistry; -import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimService; import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.KryoShimServiceLoader; import java.util.Map; @@ -75,11 +68,8 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { // toy graph inputRDD does not have corresponding outputRDD so where jobs chain, it fails (failing makes sense) if (null != loadGraphWith && !test.equals(ProgramTest.Traversals.class) && -!test.equals(GroovyProgramTest.Traversals.class) && !test.equals(PageRankTest.Traversals.class) && -!test.equals(GroovyPageRankTest.Traversals.class) && !test.equals(PeerPressureTest.Traversals.class) && -!test.equals(GroovyPeerPressureTest.Traversals.class) && !test.equals(FileSystemStorageCheck.class) && !testMethodName.equals("shouldSupportJobChaining") && // GraphComputerTest.shouldSupportJobChaining RANDOM.nextBoolean()) { @@ -97,7 +87,7 @@ public class SparkHadoopGraphProvider extends HadoopGraphProvider { Spark.close(); HadoopPools.close();
[1/3] tinkerpop git commit: TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1612 4b5e9410f -> eaedc39de TINKERPOP-1612 Removed exclusion of commons-lang3 for neo4j That used to come in as part of gremlin-groovy, but since neo4j-gremlin no longer depends on that we need to remove the exclusion. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/eaedc39d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/eaedc39d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/eaedc39d Branch: refs/heads/TINKERPOP-1612 Commit: eaedc39def289a22efdc44fdb9c57e24d12dc960 Parents: cbf38b6 Author: Stephen MalletteAuthored: Thu Jan 26 10:58:14 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:56:18 2017 -0500 -- neo4j-gremlin/pom.xml | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/eaedc39d/neo4j-gremlin/pom.xml -- diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index cedd11e..7602cc0 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -122,10 +122,6 @@ limitations under the License. test -org.apache.commons -commons-lang3 - - com.googlecode.concurrentlinkedhashmap concurrentlinkedhashmap-lru
[3/3] tinkerpop git commit: TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff
TINKERPOP-1612 Remove references to gremlin-groovy-test in hadoop stuff Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cbf38b6d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cbf38b6d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cbf38b6d Branch: refs/heads/TINKERPOP-1612 Commit: cbf38b6dca0744ad363306a9456bbd1fbbf25af3 Parents: 4b5e941 Author: Stephen MalletteAuthored: Thu Jan 26 10:21:10 2017 -0500 Committer: Stephen Mallette Committed: Thu Jan 26 14:56:18 2017 -0500 -- giraph-gremlin/pom.xml | 11 - .../groovy/plugin/GiraphGremlinPlugin.java | 65 --- ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - ...GraphComputerGroovyProcessIntegrateTest.java | 33 -- .../src/test/resources/gremlin-server.yaml | 8 +- .../gremlin/groovy/util/SugarTestHelper.groovy | 1 - .../groovy/plugin/HadoopGremlinPlugin.java | 104 - .../groovy/plugin/HadoopRemoteAcceptor.java | 122 -- .../gremlin/hadoop/structure/HadoopGraph.java | 103 - .../structure/io/script/ScriptRecordWriter.java | 11 +- ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - .../gremlin/hadoop/HadoopGraphProvider.java | 5 +- .../gremlin/hadoop/HadoopGremlinSuite.java | 2 +- .../groovy/plugin/HadoopGremlinPluginCheck.java | 395 -- .../hadoop/jsr223/HadoopGremlinPluginCheck.java | 397 +++ .../HadoopGraphGroovyProcessStandardTest.java | 33 -- pom.xml | 2 +- spark-gremlin/pom.xml | 11 - .../spark/groovy/plugin/SparkGremlinPlugin.java | 74 ...inkerpop.gremlin.groovy.plugin.GremlinPlugin | 1 - .../computer/SparkHadoopGraphProvider.java | 16 +- ...GraphComputerGroovyProcessIntegrateTest.java | 33 -- .../gremlin/spark/util/SugarTestHelper.java | 56 +++ 23 files changed, 469 insertions(+), 1016 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/giraph-gremlin/pom.xml -- diff --git a/giraph-gremlin/pom.xml b/giraph-gremlin/pom.xml index 9a21f36..8f2ee83 100644 --- a/giraph-gremlin/pom.xml +++ b/giraph-gremlin/pom.xml @@ -43,11 +43,6 @@ limitations under the License. org.apache.tinkerpop -gremlin-groovy -${project.version} - - -org.apache.tinkerpop hadoop-gremlin ${project.version} @@ -165,12 +160,6 @@ limitations under the License. org.apache.tinkerpop -gremlin-groovy-test -${project.version} -test - - -org.apache.tinkerpop tinkergraph-gremlin ${project.version} test http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cbf38b6d/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java -- diff --git a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java b/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java deleted file mode 100644 index 80d98f9..000 --- a/giraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/giraph/groovy/plugin/GiraphGremlinPlugin.java +++ /dev/null @@ -1,65 +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.giraph.groovy.plugin; - -import org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphGraphComputer; -import org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.plugin.IllegalEnvironmentException; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; -import
[06/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java new file mode 100644 index 000..84542e1 --- /dev/null +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineOverGraphTest.java @@ -0,0 +1,406 @@ +/* + * 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.groovy.jsr223; + +import groovy.lang.MissingPropertyException; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.apache.tinkerpop.gremlin.util.config.YamlConfiguration; +import org.junit.Assert; +import org.junit.Test; + +import javax.script.Bindings; +import javax.script.CompiledScript; +import javax.script.ScriptEngine; +import javax.script.ScriptException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.concurrent.CountDownLatch; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class GremlinGroovyScriptEngineOverGraphTest { + +@Test +public void shouldDoSomeGremlin() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engine = new GremlinGroovyScriptEngine(); +final List list = new ArrayList(); +final Bindings bindings = engine.createBindings(); +bindings.put("g", g); +bindings.put("marko", convertToVertexId(graph, "marko")); +bindings.put("temp", list); +assertEquals(list.size(), 0); +engine.eval("g.V(marko).out().fill(temp)",bindings); +assertEquals(list.size(), 3); +} + +@Test +public void shouldLoadImports() throws Exception { +final Graph graph = TinkerFactory.createModern(); +final GraphTraversalSource g = graph.traversal(); +final ScriptEngine engineNoImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); +try { +engineNoImports.eval("Vertex.class.getName()"); +fail("Should have thrown an exception because no imports were supplied"); +} catch (Exception se) { +assertTrue(se instanceof ScriptException); +} + +final ScriptEngine engineWithImports = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) new DefaultImportCustomizerProvider()); +engineWithImports.put("g", g); +assertEquals(Vertex.class.getName(), engineWithImports.eval("Vertex.class.getName()")); +assertEquals(2l, engineWithImports.eval("g.V().has('age',gt(30)).count().next()")); +assertEquals(Direction.IN,
[10/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy deleted file mode 100644 index e1206df..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy +++ /dev/null @@ -1,43 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySimplePathTest { - -public static class Traversals extends SimplePathTest { - -@Override -public Traversalget_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id); -} - -@Override -public Traversal get_g_V_repeatXboth_simplePathX_timesX3X_path() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both.simplePath).times(3).path()"); -} -} -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy deleted file mode 100644 index 38c2a1d..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy +++ /dev/null @@ -1,92 +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.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyTailTest { - -public static class Traversals extends TailTest { - -@Override -public Traversal get_g_V_valuesXnameX_order_tailXglobal_2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(global, 2)") -} - -@Override -public Traversal get_g_V_valuesXnameX_order_tailX2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(2)") -} - -@Override -public
[07/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java -- diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java deleted file mode 100644 index e3a713d..000 --- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/dsl/credential/CredentialGraphTest.java +++ /dev/null @@ -1,121 +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.groovy.jsr223.dsl.credential; - -import org.apache.tinkerpop.gremlin.AbstractGremlinTest; -import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.FeatureRequirementSet; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.hamcrest.MatcherAssert; -import org.junit.Test; - -import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph.credentials; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public class CredentialGraphTest extends AbstractGremlinTest { - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldCreateUser() { -final Vertex v = credentials(graph).createUser("stephen", "secret"); -assertEquals("stephen", v.value("username")); -assertEquals("user", v.label()); -assertNotEquals("secret", v.value("password")); // hashed to something -assertThat(v.value("password").toString().length(), greaterThan(0)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES) -public void shouldRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(1, credentials(graph).removeUser("stephen")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotRemoveUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("stephen", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(0, credentials(graph).removeUser("stephanie")); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -final Vertex stephen = credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -MatcherAssert.assertThat(graph.vertices().hasNext(), is(true)); - -assertEquals(stephen, credentials(graph).findUser("stephen")); -} - -@Test -@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY) -public void shouldNotFindUser() { -MatcherAssert.assertThat(graph.vertices().hasNext(), is(false)); -credentials(graph).createUser("marko", "secret"); -credentials(graph).createUser("stephen", "secret"); -credentials(graph).createUser("daniel", "secret"); -
[05/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-server/conf/gremlin-server-modern-readonly.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml index d4ff8d4..7750ad3 100644 --- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml +++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern-readonly.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-server/conf/gremlin-server-modern.yaml -- diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml index 08096f6..5d0a67d 100644 --- a/gremlin-server/conf/gremlin-server-modern.yaml +++ b/gremlin-server/conf/gremlin-server-modern.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 3 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/generate-modern.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-server/conf/gremlin-server-neo4j.yaml -- diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml index 1d4003e..0ca8b9c 100644 --- a/gremlin-server/conf/gremlin-server-neo4j.yaml +++ b/gremlin-server/conf/gremlin-server-neo4j.yaml @@ -31,13 +31,12 @@ scriptEvaluationTimeout: 3 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/neo4j-empty.properties} -plugins: - - tinkerpop.neo4j scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], -scripts: [scripts/empty-sample.groovy]}} +plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy] serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-server/conf/gremlin-server-rest-modern.yaml -- diff --git
[02/13] 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/1169f616 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1169f616 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1169f616 Branch: refs/heads/TINKERPOP-1612 Commit: 1169f61680f0e0e40d227ca7d818c83eb8341e22 Parents: d18dd02 956f350 Author: Stephen MalletteAuthored: Wed Jan 25 09:28:30 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 09:28:30 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 6 ++ 1 file changed, 6 insertions(+) --
[08/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy deleted file mode 100644 index a478f6f..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy +++ /dev/null @@ -1,84 +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.process.traversal.step.sideEffect - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySackTest { - -public static class Traversals extends SackTest { - -@Override -public Traversalget_g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack('hello').V.outE.sack(assign).by(label).inV.sack") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.outE.sack(sum).by('weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum).by('weight').inV).times(2).sack()") -} - -@Override -public Traversal get_g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V().outE.sack(sum, 'weight').inV.sack.sum()") -} - -@Override -public Traversal get_g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(0.0d).V.repeat(__.outE.sack(sum, 'weight').inV).times(2).sack") -} - -@Override -public Traversal get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack{[:]}{ it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()") -} - -@Override -public Traversal get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(1.0d,sum).V(v1Id).local(out('knows').barrier(normSack)).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1, sum).V.out.barrier.sack") -} - -@Override -public Traversal get_g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withBulk(false).withSack(1.0d, sum).V(v1Id).local(outE('knows').barrier(normSack).inV).in('knows').barrier.sack", "v1Id", v1Id) -} - -@Override -Traversal get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.withSack(BigInteger.TEN.pow(1000), assign).V.local(out('knows').barrier(normSack)).in('knows').barrier.sack") -}
[12/13] tinkerpop git commit: TINKERPOP-1612 Configure tests to allow them to pass under new plugins
TINKERPOP-1612 Configure tests to allow them to pass under new plugins Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/010e66a7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/010e66a7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/010e66a7 Branch: refs/heads/TINKERPOP-1612 Commit: 010e66a72a1c6b10af00efa21ff4c65344236551 Parents: 34bbd6a Author: Stephen MalletteAuthored: Wed Jan 25 06:52:10 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:22:41 2017 -0500 -- .../gremlin/groovy/engine/GremlinExecutor.java | 4 +--- .../gremlin/server/GremlinServerIntegrateTest.java | 16 +--- 2 files changed, 6 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/010e66a7/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 8fdb86e..80e72fd 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -128,10 +128,8 @@ public class GremlinExecutor implements AutoCloseable { // deprecated code around this is removed. if (!useGremlinScriptEngineManager) this.scriptEngines = createScriptEngines(); -else { +else this.scriptEngines = null; -gremlinScriptEngineManager.getEngineByName("gremlin-groovy"); -} this.suppliedExecutor = suppliedExecutor; this.suppliedScheduledExecutor = suppliedScheduledExecutor; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/010e66a7/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 3792022..766ebf3 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -42,8 +42,8 @@ import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -64,7 +64,6 @@ import org.junit.Test; import java.lang.reflect.Field; import java.nio.channels.ClosedChannelException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -76,7 +75,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -93,7 +91,6 @@ import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeThat; import static org.junit.Assert.assertEquals; /** @@ -170,6 +167,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration return settings; case "shouldUseSimpleSandbox": settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); +// remove the script because it isn't used in the test but also because it's not CompileStatic ready +
[13/13] tinkerpop git commit: TINKERPOP-1612 Reconfigure some tests for new plugins.
TINKERPOP-1612 Reconfigure some tests for new plugins. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/54133ad2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/54133ad2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/54133ad2 Branch: refs/heads/TINKERPOP-1612 Commit: 54133ad233404535bb89e11e09533cfe2d19423b Parents: 010e66a Author: Stephen MalletteAuthored: Wed Jan 25 12:34:09 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:22:41 2017 -0500 -- .../python/driver/gremlin-server-modern-secure-py.yaml| 3 +-- .../tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java | 7 +-- .../gremlin/server/GremlinResultSetIntegrateTest.java | 5 - .../gremlin/server/GremlinServerHttpIntegrateTest.java| 5 - 4 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54133ad2/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml -- diff --git a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml index c846cf4..3f23946 100644 --- a/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml +++ b/gremlin-python/src/test/resources/org/apache/tinkerpop/gremlin/python/driver/gremlin-server-modern-secure-py.yaml @@ -32,10 +32,9 @@ graphs: { graph: src/test/resources/org/apache/tinkerpop/gremlin/python/driver/tinkergraph-empty.properties} scriptEngines: { gremlin-groovy: { -imports: [java.lang.Math], -staticImports: [java.lang.Math.PI], plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [src/test/resources/org/apache/tinkerpop/gremlin/python/driver/generate-modern.groovy]}}}, gremlin-jython: {}, gremlin-python: {} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54133ad2/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java index a8164b5..658244d 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java @@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode; import org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer; import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; +import org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin; import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex; @@ -134,7 +135,9 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration try { final String p = TestHelper.generateTempFileFromResource( GremlinDriverIntegrateTest.class, "generate-shouldRebindTraversalSourceVariables.groovy", "").getAbsolutePath(); -settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList(p); +final Map m = new HashMap<>(); +m.put("files", Collections.singletonList(p)); + settings.scriptEngines.get("gremlin-groovy").plugins.put(ScriptFileGremlinPlugin.class.getName(), m); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -672,7 +675,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration final Cluster cluster = TestClientFactory.build().serializer(serializer).create(); final Client client = cluster.connect(); -
[04/13] 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/46a68f9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/46a68f9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/46a68f9b Branch: refs/heads/TINKERPOP-1612 Commit: 46a68f9b7f9eceed8ae10e50d23cfecfe418f4b2 Parents: 1169f61 28dffda Author: Stephen MalletteAuthored: Wed Jan 25 13:22:02 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:22:02 2017 -0500 -- .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --
[03/13] tinkerpop git commit: Fixed how plugins are bound to a scriptengine.
Fixed how plugins are bound to a scriptengine. Didn't have the reflection code right for finding the appliesTo method CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28dffda6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28dffda6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28dffda6 Branch: refs/heads/TINKERPOP-1612 Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b Parents: 956f350 Author: Stephen MalletteAuthored: Wed Jan 25 13:20:53 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:20:53 2017 -0500 -- .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 349af8e..8fdb86e 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -40,6 +40,7 @@ import java.io.FileReader; import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable { } try { -final Method appliesTo = builderClazz.getMethod("appliesTo"); -pluginBuilder = appliesTo.invoke(pluginBuilder, language); +final Method appliesTo = builderClazz.getMethod("appliesTo", Collection.class); +pluginBuilder = appliesTo.invoke(pluginBuilder, Collections.singletonList(language)); } catch (NoSuchMethodException ignored) { }
[11/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/34bbd6a1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/34bbd6a1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/34bbd6a1 Branch: refs/heads/TINKERPOP-1612 Commit: 34bbd6a143bc89855132054e0cabbcd841580abe Parents: 46a68f9 Author: Stephen MalletteAuthored: Tue Jan 24 07:22:07 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:22:41 2017 -0500 -- gremlin-groovy-test/pom.xml | 64 --- .../groovy/loaders/SugarLoaderTest.groovy | 134 -- .../gremlin/groovy/util/SugarTestHelper.groovy | 37 -- .../step/branch/GroovyBranchTest.groovy | 58 --- .../step/branch/GroovyChooseTest.groovy | 62 --- .../step/branch/GroovyLocalTest.groovy | 91 - .../step/branch/GroovyOptionalTest.groovy | 59 --- .../step/branch/GroovyRepeatTest.groovy | 88 .../step/branch/GroovyUnionTest.groovy | 77 .../traversal/step/filter/GroovyAndTest.groovy | 52 --- .../traversal/step/filter/GroovyCoinTest.groovy | 41 -- .../step/filter/GroovyCyclicPathTest.groovy | 43 -- .../step/filter/GroovyDedupTest.groovy | 113 -- .../traversal/step/filter/GroovyDropTest.groovy | 51 --- .../step/filter/GroovyFilterTest.groovy | 73 .../traversal/step/filter/GroovyHasTest.groovy | 173 .../traversal/step/filter/GroovyIsTest.groovy | 57 --- .../traversal/step/filter/GroovyOrTest.groovy | 47 --- .../step/filter/GroovyRangeTest.groovy | 127 -- .../step/filter/GroovySampleTest.groovy | 58 --- .../step/filter/GroovySimplePathTest.groovy | 43 -- .../traversal/step/filter/GroovyTailTest.groovy | 92 - .../step/filter/GroovyWhereTest.groovy | 167 .../traversal/step/map/GroovyAddEdgeTest.groovy | 85 .../step/map/GroovyAddVertexTest.groovy | 101 - .../step/map/GroovyCoalesceTest.groovy | 59 --- .../step/map/GroovyConstantTest.groovy | 42 -- .../traversal/step/map/GroovyCountTest.groovy | 71 .../traversal/step/map/GroovyFlatMapTest.groovy | 36 -- .../traversal/step/map/GroovyFoldTest.groovy| 46 --- .../traversal/step/map/GroovyGraphTest.groovy | 55 --- .../traversal/step/map/GroovyLoopsTest.groovy | 56 --- .../traversal/step/map/GroovyMapKeysTest.groovy | 43 -- .../traversal/step/map/GroovyMapTest.groovy | 62 --- .../step/map/GroovyMapValuesTest.groovy | 48 --- .../traversal/step/map/GroovyMatchTest.groovy | 381 - .../traversal/step/map/GroovyMaxTest.groovy | 47 --- .../traversal/step/map/GroovyMeanTest.groovy| 42 -- .../traversal/step/map/GroovyMinTest.groovy | 47 --- .../traversal/step/map/GroovyOrderTest.groovy | 140 --- .../step/map/GroovyPageRankTest.groovy | 78 .../traversal/step/map/GroovyPathTest.groovy| 63 --- .../step/map/GroovyPeerPressureTest.groovy | 48 --- .../traversal/step/map/GroovyProfileTest.groovy | 94 - .../traversal/step/map/GroovyProgramTest.groovy | 50 --- .../traversal/step/map/GroovyProjectTest.groovy | 42 -- .../step/map/GroovyPropertiesTest.groovy| 60 --- .../traversal/step/map/GroovySelectTest.groovy | 242 --- .../traversal/step/map/GroovySumTest.groovy | 42 -- .../traversal/step/map/GroovyUnfoldTest.groovy | 48 --- .../step/map/GroovyValueMapTest.groovy | 51 --- .../traversal/step/map/GroovyVertexTest.groovy | 187 - .../step/sideEffect/GroovyAggregateTest.groovy | 53 --- .../step/sideEffect/GroovyExplainTest.groovy| 35 -- .../step/sideEffect/GroovyGroupCountTest.groovy | 101 - .../step/sideEffect/GroovyGroupTest.groovy | 137 --- .../step/sideEffect/GroovyGroupTestV3d0.groovy | 74 .../step/sideEffect/GroovyInjectTest.groovy | 42 -- .../step/sideEffect/GroovySackTest.groovy | 84 .../sideEffect/GroovySideEffectCapTest.groovy | 45 -- .../step/sideEffect/GroovySideEffectTest.groovy | 83 .../step/sideEffect/GroovyStoreTest.groovy | 53 --- .../step/sideEffect/GroovySubgraphTest.groovy | 50 --- .../step/sideEffect/GroovyTreeTest.groovy | 69 .../groovy/GroovyEnvironmentIntegrateSuite.java | 85 .../gremlin/groovy/GroovyEnvironmentSuite.java | 92 - .../engine/GremlinExecutorOverGraphTest.java| 108 - ...remlinGroovyScriptEngineFileSandboxTest.java | 120 -- .../GremlinGroovyScriptEngineIntegrateTest.java | 88 .../GremlinGroovyScriptEngineOverGraphTest.java | 379 - ...GroovyScriptEngineSandboxedStandardTest.java | 138 ---
[09/13] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/34bbd6a1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyOrderTest { - -public static class Traversals extends OrderTest { - -@Override -public Traversalget_g_V_name_order() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") -} - -@Override -public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") -} - -@Override -public Traversal get_g_V_order_byXname_incrX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") -} - -@Override -public Traversal get_g_V_order_byXnameX_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") -} - -@Override -public Traversal get_g_V_outE_order_byXweight_decrX_weight() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") -} - -@Override -public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") -} - -@Override -public Traversal > get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") -} - -@Override -public Traversal > get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( -final Object v1Id) { -new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { -final Map map = [:]; -map[1] = it.age; -map[2] = it.age * 2; -map[3] = it.age * 3; -map[4] = it.age; -return map; -}.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) -} - -@Override -public Traversal get_g_V_order_byXoutE_count__decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") -} - -@Override -public Traversal > get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") -} - -@Override -public Traversal get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") -} - -@Override -public Traversal >
tinkerpop git commit: Fixed how plugins are bound to a scriptengine.
Repository: tinkerpop Updated Branches: refs/heads/tp32 956f35056 -> 28dffda6b Fixed how plugins are bound to a scriptengine. Didn't have the reflection code right for finding the appliesTo method CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28dffda6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28dffda6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28dffda6 Branch: refs/heads/tp32 Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b Parents: 956f350 Author: Stephen MalletteAuthored: Wed Jan 25 13:20:53 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:20:53 2017 -0500 -- .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 349af8e..8fdb86e 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -40,6 +40,7 @@ import java.io.FileReader; import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable { } try { -final Method appliesTo = builderClazz.getMethod("appliesTo"); -pluginBuilder = appliesTo.invoke(pluginBuilder, language); +final Method appliesTo = builderClazz.getMethod("appliesTo", Collection.class); +pluginBuilder = appliesTo.invoke(pluginBuilder, Collections.singletonList(language)); } catch (NoSuchMethodException ignored) { }
[1/2] tinkerpop git commit: Fixed how plugins are bound to a scriptengine.
Repository: tinkerpop Updated Branches: refs/heads/master 1169f6168 -> 46a68f9b7 Fixed how plugins are bound to a scriptengine. Didn't have the reflection code right for finding the appliesTo method CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28dffda6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28dffda6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28dffda6 Branch: refs/heads/master Commit: 28dffda6b55dae775215ed08d5bcd2cfa280b07b Parents: 956f350 Author: Stephen MalletteAuthored: Wed Jan 25 13:20:53 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 13:20:53 2017 -0500 -- .../apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28dffda6/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java -- diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index 349af8e..8fdb86e 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -40,6 +40,7 @@ import java.io.FileReader; import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -479,8 +480,8 @@ public class GremlinExecutor implements AutoCloseable { } try { -final Method appliesTo = builderClazz.getMethod("appliesTo"); -pluginBuilder = appliesTo.invoke(pluginBuilder, language); +final Method appliesTo = builderClazz.getMethod("appliesTo", Collection.class); +pluginBuilder = appliesTo.invoke(pluginBuilder, Collections.singletonList(language)); } catch (NoSuchMethodException ignored) { }
[2/2] 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/04273705 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/04273705 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/04273705 Branch: refs/heads/master Commit: 04273705c9e8fcf23c9703670709b3b9efaf5cf1 Parents: 46a68f9 47e5ae2 Author: Stephen MalletteAuthored: Wed Jan 25 16:40:07 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:40:07 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) --
tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR
Repository: tinkerpop Updated Branches: refs/heads/tp32 28dffda6b -> 47e5ae2f3 Had to trap an exception better in ServerGremlinExecutor during init CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47e5ae2f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47e5ae2f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47e5ae2f Branch: refs/heads/tp32 Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b Parents: 28dffda Author: Stephen MalletteAuthored: Wed Jan 25 16:39:38 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:39:38 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java index 199c9f8..b9b7280 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java @@ -149,7 +149,13 @@ public class ServerGremlinExecutor { // the GremlinExecutor is using the GremlinScriptEngineManager. this is a bit of hack, but it at least allows // the global bindings to become available after the init scripts are run (DefaultGremlinScriptEngineManager // runs the init scripts when the GremlinScriptEngine is created. -settings.scriptEngines.keySet().forEach(engineName -> gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join()); +settings.scriptEngines.keySet().forEach(engineName -> { +try { +gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join(); +} catch (Exception ex) { +logger.warn(String.format("Could not initialize {} ScriptEngine as script could not be evaluated - %s", engineName), ex); +} +}); // script engine init may have altered the graph bindings or maybe even created new ones - need to // re-apply those references back
[1/2] tinkerpop git commit: Had to trap an exception better in ServerGremlinExecutor during init CTR
Repository: tinkerpop Updated Branches: refs/heads/master 46a68f9b7 -> 04273705c Had to trap an exception better in ServerGremlinExecutor during init CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47e5ae2f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47e5ae2f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47e5ae2f Branch: refs/heads/master Commit: 47e5ae2f319fb6eb20fa131a8136ded682b8045b Parents: 28dffda Author: Stephen MalletteAuthored: Wed Jan 25 16:39:38 2017 -0500 Committer: Stephen Mallette Committed: Wed Jan 25 16:39:38 2017 -0500 -- .../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47e5ae2f/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java index 199c9f8..b9b7280 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java @@ -149,7 +149,13 @@ public class ServerGremlinExecutor { // the GremlinExecutor is using the GremlinScriptEngineManager. this is a bit of hack, but it at least allows // the global bindings to become available after the init scripts are run (DefaultGremlinScriptEngineManager // runs the init scripts when the GremlinScriptEngine is created. -settings.scriptEngines.keySet().forEach(engineName -> gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join()); +settings.scriptEngines.keySet().forEach(engineName -> { +try { +gremlinExecutor.eval("1+1", engineName, Collections.emptyMap()).join(); +} catch (Exception ex) { +logger.warn(String.format("Could not initialize {} ScriptEngine as script could not be evaluated - %s", engineName), ex); +} +}); // script engine init may have altered the graph bindings or maybe even created new ones - need to // re-apply those references back
svn commit: r18417 - /release/incubator/tinkerpop/
Author: spmallette Date: Tue Feb 21 11:32:27 2017 New Revision: 18417 Log: rm ; graduated Removed: release/incubator/tinkerpop/
tinkerpop git commit: Added javadoc for skip() CTR
Repository: tinkerpop Updated Branches: refs/heads/master 5f54d1126 -> d9659cd8a Added javadoc for skip() CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d9659cd8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d9659cd8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d9659cd8 Branch: refs/heads/master Commit: d9659cd8aa81db54bce9f872a662912ba614e52d Parents: 5f54d11 Author: Stephen MalletteAuthored: Tue Feb 21 09:49:32 2017 -0500 Committer: Stephen Mallette Committed: Tue Feb 21 09:49:32 2017 -0500 -- .../process/traversal/dsl/graph/GraphTraversal.java | 15 +++ 1 file changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9659cd8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 7d0432d..c8786ab 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1685,11 +1685,26 @@ public interface GraphTraversal extends Traversal{ : new TailLocalStep<>(this.asAdmin(), limit)); } +/** + * Filters out the first {@code n} objects in the traversal. + * + * @param skip the number of objects to skip + * @return the traversal with an appended {@link RangeGlobalStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#skip-step; target="_blank">Reference Documentation - Skip Step + */ public default GraphTraversalskip(final long skip) { this.asAdmin().getBytecode().addStep(Symbols.skip, skip); return this.asAdmin().addStep(new RangeGlobalStep<>(this.asAdmin(), skip, -1)); } +/** + * Filters out the first {@code n} objects in the traversal. + * + * @param scope the scope of how to apply the {@code tail} + * @param skip the number of objects to skip + * @return the traversal with an appended {@link RangeGlobalStep} or {@link RangeLocalStep} depending on {@code scope} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#skip-step; target="_blank">Reference Documentation - Skip Step + */ public default GraphTraversalskip(final Scope scope, final long skip) { this.asAdmin().getBytecode().addStep(Symbols.skip, scope, skip); return this.asAdmin().addStep(scope.equals(Scope.global)
[1/4] tinkerpop git commit: Added javadoc for all side-effect steps CTR
Repository: tinkerpop Updated Branches: refs/heads/master cfa93a11b -> 9a3818173 Added javadoc for all side-effect steps CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dd85c733 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dd85c733 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dd85c733 Branch: refs/heads/master Commit: dd85c73301e06dfad329534c4d8b38a5ee7f7d2b Parents: c78d31b Author: Stephen MalletteAuthored: Fri Feb 17 14:55:22 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 14:55:22 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 76 1 file changed, 76 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd85c733/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 288e695..e324919 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1761,21 +1761,53 @@ public interface GraphTraversal extends Traversal{ return this.asAdmin().addStep(new TraversalSideEffectStep<>(this.asAdmin(), (Traversal) sideEffectTraversal)); } +/** + * Iterates the traversal up to the itself and emits the side-effect referenced by the key. If multiple keys are + * supplied then the side-effects are emitted as a {@code Map}. + * + * @param sideEffectKey the side-effect to emit + * @param sideEffectKeys other side-effects to emit + * @return the traversal with an appended {@link SideEffectCapStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#cap-step; target="_blank">Reference Documentation - Cap Step + */ public default GraphTraversalcap(final String sideEffectKey, final String... sideEffectKeys) { this.asAdmin().getBytecode().addStep(Symbols.cap, sideEffectKey, sideEffectKeys); return this.asAdmin().addStep(new SideEffectCapStep<>(this.asAdmin(), sideEffectKey, sideEffectKeys)); } +/** + * Extracts a portion of the graph being traversed into a {@link Graph} object held in the specified side-effect + * key. + * + * @param sideEffectKey the name of the side-effect key that will hold the subgraph + * @return the traversal with an appended {@link SubgraphStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#subgraph-step; target="_blank">Reference Documentation - Subgraph Step + */ public default GraphTraversalsubgraph(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.subgraph, sideEffectKey); return this.asAdmin().addStep(new SubgraphStep(this.asAdmin(), sideEffectKey)); } +/** + * Eagerly collects objects up to this step into a side-effect. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregated objects + * @return the traversal with an appended {@link AggregateStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#aggregate-step; target="_blank">Reference Documentation - Aggregate Step + */ public default GraphTraversalaggregate(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.aggregate, sideEffectKey); return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey)); } +/** + * Organize objects in the stream into a {@code Map}. Calls to {@code group()} are typically accompanied with + * {@link #by()} modulators which help specify how the grouping should occur. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregated grouping + * @return the traversal with an appended {@link GroupStep}. + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#group-step; target="_blank">Reference Documentation - Group Step + */ public default GraphTraversalgroup(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.group, sideEffectKey); return this.asAdmin().addStep(new GroupSideEffectStep<>(this.asAdmin(), sideEffectKey)); @@ -1789,16 +1821,38 @@ public interface GraphTraversalextends
[2/4] tinkerpop git commit: Added javadoc for choose CTR
Added javadoc for choose CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/be65b293 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/be65b293 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/be65b293 Branch: refs/heads/master Commit: be65b293285d755103da2d54b506ef872db7a434 Parents: dd85c73 Author: Stephen MalletteAuthored: Fri Feb 17 15:12:53 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 15:12:53 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 56 1 file changed, 56 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be65b293/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index e324919..75c8e38 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1992,34 +1992,90 @@ public interface GraphTraversal extends Traversal{ return this.asAdmin().addStep(branchStep); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else + * like semantics within a traversal. A {@code choose} is modified by {@link #option} which provides the various + * branch choices. + * + * @param choiceTraversal the traversal used to determine the value for the branch + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public defaultGraphTraversal choose(final Traversal choiceTraversal) { this.asAdmin().getBytecode().addStep(Symbols.choose, choiceTraversal); return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin) choiceTraversal)); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else + * like semantics within a traversal. + * + * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else + * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true + * @param falseChoice the traversal to execute in the event the {@code traversalPredicate} returns false + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public default GraphTraversal choose(final Traversal traversalPredicate, final Traversal trueChoice, final Traversal falseChoice) { this.asAdmin().getBytecode().addStep(Symbols.choose, traversalPredicate, trueChoice, falseChoice); return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) traversalPredicate, (Traversal.Admin ) trueChoice, (Traversal.Admin ) falseChoice)); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then + * like semantics within a traversal. + * + * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else + * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public default GraphTraversal choose(final Traversal traversalPredicate, final Traversal trueChoice) { this.asAdmin().getBytecode().addStep(Symbols.choose, traversalPredicate, trueChoice); return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) traversalPredicate, (Traversal.Admin ) trueChoice, (Traversal.Admin ) __.identity())); } +/** + * Routes the current traverser to a particular
[2/3] tinkerpop git commit: Added javadoc for choose CTR
Added javadoc for choose CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/be65b293 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/be65b293 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/be65b293 Branch: refs/heads/tp32 Commit: be65b293285d755103da2d54b506ef872db7a434 Parents: dd85c73 Author: Stephen MalletteAuthored: Fri Feb 17 15:12:53 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 15:12:53 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 56 1 file changed, 56 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be65b293/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index e324919..75c8e38 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1992,34 +1992,90 @@ public interface GraphTraversal extends Traversal{ return this.asAdmin().addStep(branchStep); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else + * like semantics within a traversal. A {@code choose} is modified by {@link #option} which provides the various + * branch choices. + * + * @param choiceTraversal the traversal used to determine the value for the branch + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public defaultGraphTraversal choose(final Traversal choiceTraversal) { this.asAdmin().getBytecode().addStep(Symbols.choose, choiceTraversal); return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin) choiceTraversal)); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then-else + * like semantics within a traversal. + * + * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else + * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true + * @param falseChoice the traversal to execute in the event the {@code traversalPredicate} returns false + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public default GraphTraversal choose(final Traversal traversalPredicate, final Traversal trueChoice, final Traversal falseChoice) { this.asAdmin().getBytecode().addStep(Symbols.choose, traversalPredicate, trueChoice, falseChoice); return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) traversalPredicate, (Traversal.Admin ) trueChoice, (Traversal.Admin ) falseChoice)); } +/** + * Routes the current traverser to a particular traversal branch option which allows the creation of if-then + * like semantics within a traversal. + * + * @param traversalPredicate the traversal used to determine the "if" portion of the if-then-else + * @param trueChoice the traversal to execute in the event the {@code traversalPredicate} returns true + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#choose-step; target="_blank">Reference Documentation - Choose Step + */ public default GraphTraversal choose(final Traversal traversalPredicate, final Traversal trueChoice) { this.asAdmin().getBytecode().addStep(Symbols.choose, traversalPredicate, trueChoice); return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) traversalPredicate, (Traversal.Admin ) trueChoice, (Traversal.Admin ) __.identity())); } +/** + * Routes the current traverser to a particular
[4/4] 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/9a381817 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9a381817 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9a381817 Branch: refs/heads/master Commit: 9a3818173b33c76a49f5cab1489420c4abb50de3 Parents: cfa93a1 c7d666d Author: Stephen MalletteAuthored: Fri Feb 17 15:32:03 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 15:32:03 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 208 +++ 1 file changed, 208 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a381817/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 06f8070,eaf2cc1..346eac0 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@@ -1986,21 -2082,49 +2118,49 @@@ public interface GraphTraversal e return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) __.filter(new PredicateTraverser<>(choosePredicate)), (Traversal.Admin ) trueChoice, (Traversal.Admin ) __.identity())); } + /** + * Returns the result of the specified traversal if it yields a result, otherwise it returns the calling element. + * + * @param optionalTraversal the traversal to execute for a potential result + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#optional-step; target="_blank">Reference Documentation - Optional Step + */ public default GraphTraversal optional(final Traversal optionalTraversal) { this.asAdmin().getBytecode().addStep(Symbols.optional, optionalTraversal); -return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin) optionalTraversal, (Traversal.Admin ) optionalTraversal.asAdmin().clone(), (Traversal.Admin ) __.identity())); +return this.asAdmin().addStep(new OptionalStep<>(this.asAdmin(), (Traversal.Admin ) optionalTraversal)); } + /** + * Merges the results of an arbitrary number of traversals. + * + * @param unionTraversals the traversals to merge + * @return the traversal with the appended {@link UnionStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#union-step; target="_blank">Reference Documentation - Union Step + */ public default GraphTraversal union(final Traversal... unionTraversals) { this.asAdmin().getBytecode().addStep(Symbols.union, unionTraversals); -return this.asAdmin().addStep(new UnionStep(this.asAdmin(), Arrays.copyOf(unionTraversals, unionTraversals.length, Traversal.Admin[].class))); +return this.asAdmin().addStep(new UnionStep<>(this.asAdmin(), Arrays.copyOf(unionTraversals, unionTraversals.length, Traversal.Admin[].class))); } + /** + * Evaluates the provided traversals and returns the result of the first traversal to emit at least one object. + * + * @param coalesceTraversals the traversals to coalesce + * @return the traversal with the appended {@link CoalesceStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#coalesce-step; target="_blank">Reference Documentation - Coalesce Step + */ public default GraphTraversalcoalesce(final Traversal... coalesceTraversals) { this.asAdmin().getBytecode().addStep(Symbols.coalesce, coalesceTraversals); -return this.asAdmin().addStep(new CoalesceStep(this.asAdmin(), Arrays.copyOf(coalesceTraversals, coalesceTraversals.length, Traversal.Admin[].class))); +return this.asAdmin().addStep(new CoalesceStep<>(this.asAdmin(), Arrays.copyOf(coalesceTraversals, coalesceTraversals.length, Traversal.Admin[].class))); } + /** + * This step is used for looping over a some traversal given some break predicate. + * + * @param repeatTraversal the traversal to repeat over + * @return the traversal with the appended {@link RepeatStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step; target="_blank">Reference Documentation - Repeat Step + */ public default GraphTraversal
[3/3] tinkerpop git commit: Added javadoc for all branch steps CTR
Added javadoc for all branch steps CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c7d666dd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c7d666dd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c7d666dd Branch: refs/heads/tp32 Commit: c7d666ddb7930a1fd09ba521c985bc1462399765 Parents: be65b29 Author: Stephen MalletteAuthored: Fri Feb 17 15:31:40 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 15:31:40 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 76 1 file changed, 76 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c7d666dd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 75c8e38..eaf2cc1 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -2082,51 +2082,120 @@ public interface GraphTraversal extends Traversal{ return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) __.filter(new PredicateTraverser<>(choosePredicate)), (Traversal.Admin ) trueChoice, (Traversal.Admin ) __.identity())); } +/** + * Returns the result of the specified traversal if it yields a result, otherwise it returns the calling element. + * + * @param optionalTraversal the traversal to execute for a potential result + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#optional-step; target="_blank">Reference Documentation - Optional Step + */ public default GraphTraversal optional(final Traversal optionalTraversal) { this.asAdmin().getBytecode().addStep(Symbols.optional, optionalTraversal); return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin) optionalTraversal, (Traversal.Admin ) optionalTraversal.asAdmin().clone(), (Traversal.Admin ) __.identity())); } +/** + * Merges the results of an arbitrary number of traversals. + * + * @param unionTraversals the traversals to merge + * @return the traversal with the appended {@link UnionStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#union-step; target="_blank">Reference Documentation - Union Step + */ public default GraphTraversal union(final Traversal... unionTraversals) { this.asAdmin().getBytecode().addStep(Symbols.union, unionTraversals); return this.asAdmin().addStep(new UnionStep(this.asAdmin(), Arrays.copyOf(unionTraversals, unionTraversals.length, Traversal.Admin[].class))); } +/** + * Evaluates the provided traversals and returns the result of the first traversal to emit at least one object. + * + * @param coalesceTraversals the traversals to coalesce + * @return the traversal with the appended {@link CoalesceStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#coalesce-step; target="_blank">Reference Documentation - Coalesce Step + */ public default GraphTraversalcoalesce(final Traversal... coalesceTraversals) { this.asAdmin().getBytecode().addStep(Symbols.coalesce, coalesceTraversals); return this.asAdmin().addStep(new CoalesceStep(this.asAdmin(), Arrays.copyOf(coalesceTraversals, coalesceTraversals.length, Traversal.Admin[].class))); } +/** + * This step is used for looping over a some traversal given some break predicate. + * + * @param repeatTraversal the traversal to repeat over + * @return the traversal with the appended {@link RepeatStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step; target="_blank">Reference Documentation - Repeat Step + */ public default GraphTraversalrepeat(final Traversal repeatTraversal) { this.asAdmin().getBytecode().addStep(Symbols.repeat, repeatTraversal); return RepeatStep.addRepeatToTraversal(this, (Traversal.Admin) repeatTraversal); } +/** + * Emit is used in conjunction with {@link #repeat(Traversal)} to determine what objects get emit from the loop. + *
[3/4] tinkerpop git commit: Added javadoc for all branch steps CTR
Added javadoc for all branch steps CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c7d666dd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c7d666dd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c7d666dd Branch: refs/heads/master Commit: c7d666ddb7930a1fd09ba521c985bc1462399765 Parents: be65b29 Author: Stephen MalletteAuthored: Fri Feb 17 15:31:40 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 15:31:40 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 76 1 file changed, 76 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c7d666dd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 75c8e38..eaf2cc1 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -2082,51 +2082,120 @@ public interface GraphTraversal extends Traversal{ return this.asAdmin().addStep(new ChooseStep(this.asAdmin(), (Traversal.Admin ) __.filter(new PredicateTraverser<>(choosePredicate)), (Traversal.Admin ) trueChoice, (Traversal.Admin ) __.identity())); } +/** + * Returns the result of the specified traversal if it yields a result, otherwise it returns the calling element. + * + * @param optionalTraversal the traversal to execute for a potential result + * @return the traversal with the appended {@link ChooseStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#optional-step; target="_blank">Reference Documentation - Optional Step + */ public default GraphTraversal optional(final Traversal optionalTraversal) { this.asAdmin().getBytecode().addStep(Symbols.optional, optionalTraversal); return this.asAdmin().addStep(new ChooseStep<>(this.asAdmin(), (Traversal.Admin) optionalTraversal, (Traversal.Admin ) optionalTraversal.asAdmin().clone(), (Traversal.Admin ) __.identity())); } +/** + * Merges the results of an arbitrary number of traversals. + * + * @param unionTraversals the traversals to merge + * @return the traversal with the appended {@link UnionStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#union-step; target="_blank">Reference Documentation - Union Step + */ public default GraphTraversal union(final Traversal... unionTraversals) { this.asAdmin().getBytecode().addStep(Symbols.union, unionTraversals); return this.asAdmin().addStep(new UnionStep(this.asAdmin(), Arrays.copyOf(unionTraversals, unionTraversals.length, Traversal.Admin[].class))); } +/** + * Evaluates the provided traversals and returns the result of the first traversal to emit at least one object. + * + * @param coalesceTraversals the traversals to coalesce + * @return the traversal with the appended {@link CoalesceStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#coalesce-step; target="_blank">Reference Documentation - Coalesce Step + */ public default GraphTraversalcoalesce(final Traversal... coalesceTraversals) { this.asAdmin().getBytecode().addStep(Symbols.coalesce, coalesceTraversals); return this.asAdmin().addStep(new CoalesceStep(this.asAdmin(), Arrays.copyOf(coalesceTraversals, coalesceTraversals.length, Traversal.Admin[].class))); } +/** + * This step is used for looping over a some traversal given some break predicate. + * + * @param repeatTraversal the traversal to repeat over + * @return the traversal with the appended {@link RepeatStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step; target="_blank">Reference Documentation - Repeat Step + */ public default GraphTraversalrepeat(final Traversal repeatTraversal) { this.asAdmin().getBytecode().addStep(Symbols.repeat, repeatTraversal); return RepeatStep.addRepeatToTraversal(this, (Traversal.Admin) repeatTraversal); } +/** + * Emit is used in conjunction with {@link #repeat(Traversal)} to determine what objects get emit from the loop. +
[2/2] tinkerpop git commit: Merge branch 'tp32'
Merge branch 'tp32' Conflicts: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/db6d5217 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/db6d5217 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/db6d5217 Branch: refs/heads/master Commit: db6d5217873f1ce4e2eda0e4f6ef63343d02fbc3 Parents: 9a38181 372dfd8 Author: Stephen MalletteAuthored: Fri Feb 17 16:04:51 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 16:04:51 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 165 +-- 1 file changed, 155 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/db6d5217/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 346eac0,a8624e6..7d0432d --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@@ -2255,11 -2219,22 +2255,23 @@@ public interface GraphTraversal e /// VERTEX PROGRAM STEPS + /** + * Calculates a PageRank over the graph using a 0.85 for the {@code alpha} value. + * + * @return the traversal with the appended {@link PageRankVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#pagerank-step; target="_blank">Reference Documentation - PageRank Step + */ public default GraphTraversalpageRank() { -return this.pageRank(0.85d); +this.asAdmin().getBytecode().addStep(Symbols.pageRank); +return this.asAdmin().addStep((Step) new PageRankVertexProgramStep(this.asAdmin(), 0.85d)); } + /** + * Calculates a PageRank over the graph. + * + * @return the traversal with the appended {@link PageRankVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#pagerank-step; target="_blank">Reference Documentation - PageRank Step + */ public default GraphTraversal pageRank(final double alpha) { this.asAdmin().getBytecode().addStep(Symbols.pageRank, alpha); return this.asAdmin().addStep((Step) new PageRankVertexProgramStep(this.asAdmin(), alpha)); @@@ -2287,11 -2282,26 +2319,27 @@@ return this; } + /** + * Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to + * the size of the barrier. In this case, it iterates the entire thing as the default barrier size is set to + * {@code Integer.MAX_VALUE}. + * + * @return the traversal with an appended {@link NoOpBarrierStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#barrier-step; target="_blank">Reference Documentation - Barrier Step + */ public default GraphTraversal barrier() { -return this.barrier(Integer.MAX_VALUE); +this.asAdmin().getBytecode().addStep(Symbols.barrier); +return this.asAdmin().addStep(new NoOpBarrierStep<>(this.asAdmin(), Integer.MAX_VALUE)); } + /** + * Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically iterates that traversal to + * the size of the barrier. + * + * @param maxBarrierSize the size of the barrier + * @return the traversal with an appended {@link NoOpBarrierStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#barrier-step; target="_blank">Reference Documentation - Barrier Step + */ public default GraphTraversalbarrier(final int maxBarrierSize) { this.asAdmin().getBytecode().addStep(Symbols.barrier, maxBarrierSize); return this.asAdmin().addStep(new NoOpBarrierStep<>(this.asAdmin(), maxBarrierSize)); @@@ -2379,16 -2470,28 +2508,29 @@@ + /** + * This step modifies {@link #choose(Function)} to specifies the available choices that might be executed. + * + * @param pickToken the token that would trigger this option + * @param traversalOption the option as a traversal + * @return the traversal with the modulated step + */ -public defaultGraphTraversal option(final M pickToken, final TraversaltraversalOption) { +
tinkerpop git commit: Added javadoc for all the modulators CTR
Repository: tinkerpop Updated Branches: refs/heads/tp32 c7d666ddb -> 372dfd801 Added javadoc for all the modulators CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/372dfd80 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/372dfd80 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/372dfd80 Branch: refs/heads/tp32 Commit: 372dfd80123c9e987eac8805891561bc45bc840b Parents: c7d666d Author: Stephen MalletteAuthored: Fri Feb 17 16:02:15 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 16:02:15 2017 -0500 -- .../traversal/dsl/graph/GraphTraversal.java | 165 +-- 1 file changed, 155 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/372dfd80/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index eaf2cc1..a8624e6 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -2219,26 +2219,58 @@ public interface GraphTraversal extends Traversal{ /// VERTEX PROGRAM STEPS +/** + * Calculates a PageRank over the graph using a 0.85 for the {@code alpha} value. + * + * @return the traversal with the appended {@link PageRankVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#pagerank-step; target="_blank">Reference Documentation - PageRank Step + */ public default GraphTraversalpageRank() { return this.pageRank(0.85d); } +/** + * Calculates a PageRank over the graph. + * + * @return the traversal with the appended {@link PageRankVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#pagerank-step; target="_blank">Reference Documentation - PageRank Step + */ public default GraphTraversalpageRank(final double alpha) { this.asAdmin().getBytecode().addStep(Symbols.pageRank, alpha); return this.asAdmin().addStep((Step) new PageRankVertexProgramStep(this.asAdmin(), alpha)); } +/** + * Executes a Peer Pressure community detection algorithm over the graph. + * + * @return the traversal with the appended {@link PeerPressureVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#peerpressure-step; target="_blank">Reference Documentation - PeerPressure Step + */ public default GraphTraversal peerPressure() { this.asAdmin().getBytecode().addStep(Symbols.peerPressure); return this.asAdmin().addStep((Step) new PeerPressureVertexProgramStep(this.asAdmin())); } +/** + * Executes a Peer Pressure community detection algorithm over the graph. + * + * @return the traversal with the appended {@link PeerPressureVertexProgramStep} + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#peerpressure-step; target="_blank">Reference Documentation - PeerPressure Step + */ public default GraphTraversal program(final VertexProgram vertexProgram) { return this.asAdmin().addStep((Step) new ProgramVertexProgramStep(this.asAdmin(), vertexProgram)); } / UTILITY STEPS / +/** + * A step modulator that provides a lable to the step that can be accessed later in the traversal by other steps. + * + * @param stepLabel the name of the step + * @param stepLabels additional names for the label + * @return the traversal with the modified end step + * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#as-step; target="_blank">Reference Documentation - As Step + */ public default GraphTraversal as(final String stepLabel, final String... stepLabels) { this.asAdmin().getBytecode().addStep(Symbols.as, stepLabel, stepLabels); if (this.asAdmin().getSteps().size() == 0) this.asAdmin().addStep(new StartStep<>(this.asAdmin())); @@ -2250,15 +2282,40 @@ public interface GraphTraversalextends Traversal{ return this; } +/** + * Turns the lazy traversal pipeline into a bulk-synchronous pipeline which basically