tinkerpop git commit: TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-2058 e900cfc56 -> 75e26e40c (forced update) TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors. If the object to be filtered is a number, `Contains` predicates will now scan the provided collection, comparing each element using `Compare.eq`. For non-numeric values `Contains.within` will still use `collection.contains()` in order to make use of search-optimized data types (e.g. `Set`). Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/75e26e40 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/75e26e40 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/75e26e40 Branch: refs/heads/TINKERPOP-2058 Commit: 75e26e40ce2be3507fbbc406ba1af476a3ef6855 Parents: 5756c0c Author: Daniel Kuppitz Authored: Thu Oct 4 07:15:09 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 11:04:33 2018 -0700 -- CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/Contains.java | 16 +--- .../gremlin/process/traversal/ContainsTest.java | 2 +- .../tinkerpop/gremlin/process/traversal/PTest.java | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75e26e40/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 14d79aa..c03ec01 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Use `Compare.eq` in `Contains` predicates to ensure the same filter behavior for numeric values. * Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75e26e40/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java index da46d0b..35a8ca7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java @@ -18,19 +18,27 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; + import java.util.Collection; import java.util.function.BiPredicate; /** * {@link Contains} is a {@link BiPredicate} that evaluates whether the first object is contained within (or not - * within) the second collection object. For example: + * within) the second collection object. If the first object is a number, each element in the second collection + * will be compared to the first object using {@link Compare}'s {@code eq} predicate. This will ensure, that numbers + * are matched by their value only, ignoring the number type. For example: * * * gremlin Contains.within [gremlin, blueprints, furnace] == true * gremlin Contains.without [gremlin, rexster] == false * rexster Contains.without [gremlin, blueprints, furnace] == true + * 123 Contains.within [1, 2, 3] == false + * 100 Contains.within [1L, 10L, 100L] == true * * + * + * * @author Pierre De Wilde * @author Marko A. Rodriguez (http://markorodriguez.com) */ @@ -44,7 +52,9 @@ public enum Contains implements BiPredicate { within { @Override public boolean test(final Object first, final Collection second) { -return second.contains(first); +return first instanceof Number +? IteratorUtils.anyMatch(second.iterator(), o -> Compare.eq.test(first, o)) +: second.contains(first); } }, @@ -56,7 +66,7 @@ public enum Contains implements BiPredicate { without { @Override public boolean test(final Object first, final Collection second) { -return !second.contains(first); +return !within.test(first, second); } }; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75e26e40/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/ContainsTest.java -- diff --git
[1/2] tinkerpop git commit: TINKERPOP-2037 removed groovy-sql
Repository: tinkerpop Updated Branches: refs/heads/master 5756c0c84 -> f47b7d1d3 TINKERPOP-2037 removed groovy-sql Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ee6802e7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ee6802e7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ee6802e7 Branch: refs/heads/master Commit: ee6802e76a4212dfba8e63cdf3eb4baa4b9dede8 Parents: 73444c3 Author: Robert Dale Authored: Tue Oct 2 12:24:31 2018 -0400 Committer: Robert Dale Committed: Fri Oct 5 07:36:44 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/upgrade/release-3.4.x.asciidoc | 19 +++ gremlin-driver/pom.xml | 13 - 3 files changed, 20 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee6802e7/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 14d79aa..06ad72a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. * Added text predicates. +* Removed groovy-sql * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. * Removed support for `-i` option in Gremlin Server which was previously deprecated. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee6802e7/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 21e1899..d7780f3 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -44,6 +44,25 @@ gremlin> g.V().has("person","name", containing("o").and(gte("j").and(endingWith( See: link:https://issues.apache.org/jira/browse/TINKERPOP-2041[TINKERPOP-2041] + Removed groovy-sql dependency + +Gremlin Console and Gremlin Server no longer include groovy-sql. If you depend on groovy-sql, +you can install it in Gremlin Console or Gremlin Server using the plugin system. + +Console: +``` +:install org.codehaus.groovy groovy-sql 2.5.2 +``` + +Server: +``` +bin/gremlin-server.sh install org.codehaus.groovy groovy-sql 2.5.2 +``` + +If your project depended on groovy-sql transitively, simply include it in your project's build file (e.g. maven: pom.xml). + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-2037[TINKERPOP-2037] + Changed infix behavior The infix notation of `and()` and `or()` now supports an arbitrary number of traversals and `ConnectiveStrategy` produces a traversal with proper AND and OR semantics. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ee6802e7/gremlin-driver/pom.xml -- diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml index 9f1670c..724d415 100644 --- a/gremlin-driver/pom.xml +++ b/gremlin-driver/pom.xml @@ -56,19 +56,6 @@ limitations under the License. -org.codehaus.groovy -groovy-sql -${groovy.version} -indy - - - -org.codehaus.groovy -groovy - - - - org.apache.commons commons-lang3
[2/2] tinkerpop git commit: Merge branch 'TINKERPOP-2037'
Merge branch 'TINKERPOP-2037' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f47b7d1d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f47b7d1d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f47b7d1d Branch: refs/heads/master Commit: f47b7d1d38c0e0906a92f82b8b503d80799e11cb Parents: 5756c0c ee6802e Author: Robert Dale Authored: Fri Oct 5 14:02:47 2018 -0400 Committer: Robert Dale Committed: Fri Oct 5 14:02:47 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/upgrade/release-3.4.x.asciidoc | 19 +++ gremlin-driver/pom.xml | 13 - 3 files changed, 20 insertions(+), 13 deletions(-) --
[2/2] tinkerpop git commit: TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors.
TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors. If the object to be filtered is a number, `Contains` predicates will now scan the provided collection, comparing each element using `Compare.eq`. For non-numeric values `Contains.within` will still use `collection.contains()` in order to make use of search-optimized data types (e.g. `Set`). Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e900cfc5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e900cfc5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e900cfc5 Branch: refs/heads/TINKERPOP-2058 Commit: e900cfc56451b90ef7efca9e73b6ddb05f6cc308 Parents: 5756c0c Author: Daniel Kuppitz Authored: Thu Oct 4 07:15:09 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:44:29 2018 -0700 -- CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/Contains.java | 16 +--- .../gremlin/process/traversal/ContainsTest.java | 2 +- .../tinkerpop/gremlin/process/traversal/PTest.java | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e900cfc5/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 14d79aa..739737e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Use `Compare.eq` in `Contains` predicates to ensure the same filter behavior for numberic values. * Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e900cfc5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java index da46d0b..35a8ca7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java @@ -18,19 +18,27 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; + import java.util.Collection; import java.util.function.BiPredicate; /** * {@link Contains} is a {@link BiPredicate} that evaluates whether the first object is contained within (or not - * within) the second collection object. For example: + * within) the second collection object. If the first object is a number, each element in the second collection + * will be compared to the first object using {@link Compare}'s {@code eq} predicate. This will ensure, that numbers + * are matched by their value only, ignoring the number type. For example: * * * gremlin Contains.within [gremlin, blueprints, furnace] == true * gremlin Contains.without [gremlin, rexster] == false * rexster Contains.without [gremlin, blueprints, furnace] == true + * 123 Contains.within [1, 2, 3] == false + * 100 Contains.within [1L, 10L, 100L] == true * * + * + * * @author Pierre De Wilde * @author Marko A. Rodriguez (http://markorodriguez.com) */ @@ -44,7 +52,9 @@ public enum Contains implements BiPredicate { within { @Override public boolean test(final Object first, final Collection second) { -return second.contains(first); +return first instanceof Number +? IteratorUtils.anyMatch(second.iterator(), o -> Compare.eq.test(first, o)) +: second.contains(first); } }, @@ -56,7 +66,7 @@ public enum Contains implements BiPredicate { without { @Override public boolean test(final Object first, final Collection second) { -return !second.contains(first); +return !within.test(first, second); } }; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e900cfc5/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/ContainsTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/ContainsTest.java
[1/2] tinkerpop git commit: CTR: added missing import [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-2058 1955ddd0c -> e900cfc56 (forced update) CTR: added missing import Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5756c0c8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5756c0c8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5756c0c8 Branch: refs/heads/TINKERPOP-2058 Commit: 5756c0c8498897442c257868e5bf4d746c2a8f3d Parents: 4778482 Author: Daniel Kuppitz Authored: Fri Oct 5 10:43:19 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:43:19 2018 -0700 -- .../org/apache/tinkerpop/gremlin/process/traversal/Compare.java| 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5756c0c8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 4b9063f..5239a03 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,6 +18,8 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.util.NumberHelper; + import java.util.function.BiPredicate; /**
tinkerpop git commit: CTR: added missing import
Repository: tinkerpop Updated Branches: refs/heads/master 47784823d -> 5756c0c84 CTR: added missing import Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5756c0c8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5756c0c8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5756c0c8 Branch: refs/heads/master Commit: 5756c0c8498897442c257868e5bf4d746c2a8f3d Parents: 4778482 Author: Daniel Kuppitz Authored: Fri Oct 5 10:43:19 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:43:19 2018 -0700 -- .../org/apache/tinkerpop/gremlin/process/traversal/Compare.java| 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5756c0c8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 4b9063f..5239a03 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,6 +18,8 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.util.NumberHelper; + import java.util.function.BiPredicate; /**
[10/35] tinkerpop git commit: TINKERPOP-2041 Fixed .NET tests around TP predicates
TINKERPOP-2041 Fixed .NET tests around TP predicates Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/79d4a056 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/79d4a056 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/79d4a056 Branch: refs/heads/TINKERPOP-2058 Commit: 79d4a056e311971c765bf1b9bd84b48582df7698 Parents: 68c47af Author: Stephen Mallette Authored: Fri Sep 28 08:27:25 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- .../src/Gremlin.Net/Process/Traversal/TP.cs | 2 +- .../Gherkin/TraversalEvaluation/TPParameter.cs | 97 .../TraversalEvaluation/TraversalParser.cs | 4 + 3 files changed, 102 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/79d4a056/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs index ac6415d..abebd1e 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs @@ -39,7 +39,7 @@ namespace Gremlin.Net.Process.Traversal public class TP : P { /// -/// Initializes a new instance of the class. +/// Initializes a new instance of the class. /// /// The name of the predicate. /// The value of the predicate. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/79d4a056/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs new file mode 100644 index 000..9100c6f --- /dev/null +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs @@ -0,0 +1,97 @@ +#region License + +/* + * 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. + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Reflection; +using Gremlin.Net.Process.Traversal; + +namespace Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation +{ +/// +/// Represents a parameter for a traversal predicate (ie: TP.contains()) +/// +internal class TPParameter : ITokenParameter, IEquatable +{ +private IDictionary _contextParameterValues; +public IList Tokens { get; } + +public TPParameter(IList tokens) +{ +Tokens = tokens; +} + +public bool Equals(TPParameter other) +{ +return Tokens.SequenceEqual(other.Tokens); +} + +public override bool Equals(object obj) +{ +if (ReferenceEquals(null, obj)) return false; +if (ReferenceEquals(this, obj)) return true; +if (obj.GetType() != GetType()) return false; +return Equals((TPParameter) obj); +} + +public override int GetHashCode() +{ +return Tokens != null ? Tokens.GetHashCode() : 0; +} + +public object GetValue() +{ +var type = typeof(TP); +object instance = null; +for (var i = 1; i < Tokens.Count; i++) +{ +var token = Tokens[i]; +token.SetContextParameterValues(_contextParameterValues); +var method = type.GetMethod(TraversalParser.GetCsharpName(token.Name), +BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public); +if (method == null) +{ +throw new InvalidOperationException($"Predicate (TP) method '{token}' not found for testing"); +
[11/35] tinkerpop git commit: TINKERPOP-2041 Fixed gremlin-javascript serializers for TP
TINKERPOP-2041 Fixed gremlin-javascript serializers for TP Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/68c47afa Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/68c47afa Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/68c47afa Branch: refs/heads/TINKERPOP-2058 Commit: 68c47afa017deb9deabba1cf025ecddd68cd42fa Parents: 519ca65 Author: Stephen Mallette Authored: Thu Sep 27 16:33:26 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- .../gremlin-javascript/lib/structure/io/graph-serializer.js| 2 ++ .../gremlin-javascript/lib/structure/io/type-serializers.js| 1 + 2 files changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68c47afa/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js index 9ce1761..fca8375 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js @@ -162,6 +162,7 @@ const deserializers = { 'g:Property': typeSerializers.PropertySerializer, 'g:Path': typeSerializers.Path3Serializer, 'g:T': typeSerializers.TSerializer, + 'g:TP': typeSerializers.TPSerializer, 'g:List': typeSerializers.ListSerializer, 'g:Set': typeSerializers.SetSerializer, 'g:Map': typeSerializers.MapSerializer @@ -173,6 +174,7 @@ const serializers = [ typeSerializers.BytecodeSerializer, typeSerializers.TraverserSerializer, typeSerializers.PSerializer, + typeSerializers.TPSerializer, typeSerializers.LambdaSerializer, typeSerializers.EnumSerializer, typeSerializers.VertexSerializer, http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68c47afa/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js index ca81c2a..576c721 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js @@ -406,6 +406,7 @@ module.exports = { PathSerializer, PropertySerializer, PSerializer, + TPSerializer, SetSerializer, TSerializer, TraverserSerializer,
[15/35] tinkerpop git commit: renamed text predicates and added some javadoc comments
renamed text predicates and added some javadoc comments Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9b965861 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9b965861 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9b965861 Branch: refs/heads/TINKERPOP-2058 Commit: 9b965861ed9504beaebe07f99f0ce427f702 Parents: f057fb3 Author: Daniel Kuppitz Authored: Tue Oct 2 13:11:23 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 12 +-- docs/src/upgrade/release-3.4.x.asciidoc | 4 +- .../gremlin/process/traversal/Text.java | 78 ++-- .../gremlin/process/traversal/TextP.java| 28 +++ .../gremlin/process/traversal/PTest.java| 28 +++ .../GraphSONMapperPartialEmbeddedTypeTest.java | 10 +-- .../src/Gremlin.Net/Process/Traversal/TextP.cs | 24 +++--- .../TraversalEvaluation/TextPParameter.cs | 2 +- gremlin-javascript/glv/TraversalSource.template | 4 +- .../gremlin-javascript/lib/process/traversal.js | 26 +++ .../jython/gremlin_python/process/traversal.py | 60 +++ gremlin-test/features/filter/Has.feature| 20 ++--- .../process/traversal/step/filter/HasTest.java | 50 ++--- 13 files changed, 191 insertions(+), 155 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index fdd261a..85dc1c0 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3376,12 +3376,12 @@ The provided predicates are outlined in the table below and are used in various | `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? | `P.within(objects...)` | Is the incoming object in the array of provided objects? | `P.without(objects...)` | Is the incoming object not in the array of the provided objects? -| `TextP.startsWith(string)` | Does the incoming `String` start with the provided `String`? -| `TextP.endsWith(string)` | Does the incoming `String` end with the provided `String`? -| `TextP.contains(string)` | Does the incoming `String` contain the provided `String`? -| `TextP.startsNotWith(string)` | TODO: find a better name -| `TextP.endsNotWith(string)` | TODO: find a better name -| `TextP.absent(string)` | TODO: find a better name +| `TextP.startingWith(string)` | Does the incoming `String` start with the provided `String`? +| `TextP.endingWith(string)` | Does the incoming `String` end with the provided `String`? +| `TextP.containing(string)` | Does the incoming `String` contain the provided `String`? +| `TextP.notStartingWith(string)` | Does the incoming `String` not start with the provided `String`? +| `TextP.notEndingWith(string)` | Does the incoming `String` not end with the provided `String`? +| `TextP.notContaining(string)` | Does the incoming `String` not contain the provided `String`? |= [gremlin-groovy] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 213577a..21e1899 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -35,10 +35,10 @@ Gremlin now supports simple text predicates on top of the existing `P` predicate [source,groovy] -gremlin> g.V().has("person","name", contains("o")).valueMap() +gremlin> g.V().has("person","name", containing("o")).valueMap() ==>[name:[marko],age:[29]] ==>[name:[josh],age:[32]] -gremlin> g.V().has("person","name", contains("o").and(gte("j").and(endsWith("ko".valueMap() +gremlin> g.V().has("person","name", containing("o").and(gte("j").and(endingWith("ko".valueMap() ==>[name:[marko],age:[29]] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java index 5169309..9c25825 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java +++
[12/35] tinkerpop git commit: TINKERPOP-2041 Implemented text predicates
TINKERPOP-2041 Implemented text predicates Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/519ca65c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/519ca65c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/519ca65c Branch: refs/heads/TINKERPOP-2058 Commit: 519ca65c0aef496a1fc1c4d2166622c41ff9c1e4 Parents: 3a8f580 Author: Daniel Kuppitz Authored: Wed Sep 26 15:44:35 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- CHANGELOG.asciidoc | 1 + docs/src/reference/the-traversal.asciidoc | 34 +++-- docs/src/upgrade/release-3.4.x.asciidoc | 15 +++ .../tinkerpop/gremlin/jsr223/CoreImports.java | 3 + .../tinkerpop/gremlin/process/traversal/TP.java | 107 .../gremlin/process/traversal/Text.java | 123 +++ .../structure/io/graphson/GraphSONModule.java | 5 + .../io/graphson/TraversalSerializersV2d0.java | 35 ++ .../io/graphson/TraversalSerializersV3d0.java | 35 ++ .../structure/io/gryo/GryoSerializersV1d0.java | 21 .../structure/io/gryo/GryoSerializersV3d0.java | 21 .../gremlin/structure/io/gryo/GryoVersion.java | 7 +- .../gremlin/process/traversal/PTest.java| 15 +++ .../GraphSONMapperPartialEmbeddedTypeTest.java | 14 ++- gremlin-dotnet/glv/TP.template | 71 +++ gremlin-dotnet/glv/generate.groovy | 14 ++- .../src/Gremlin.Net/Process/Traversal/TP.cs | 96 +++ .../Structure/IO/GraphSON/GraphSONWriter.cs | 3 +- .../Structure/IO/GraphSON/TPSerializer.cs | 45 +++ .../gremlin/groovy/jsr223/GroovyTranslator.java | 7 ++ gremlin-javascript/glv/TraversalSource.template | 45 ++- gremlin-javascript/glv/generate.groovy | 7 ++ .../main/javascript/gremlin-javascript/index.js | 1 + .../gremlin-javascript/lib/process/traversal.js | 70 ++- .../lib/structure/io/type-serializers.js| 24 +++- .../test/cucumber/feature-steps.js | 1 + gremlin-python/glv/TraversalSource.template | 21 +++- gremlin-python/glv/generate.groovy | 9 +- .../gremlin/python/jsr223/PythonTranslator.java | 7 ++ .../jython/gremlin_python/process/traversal.py | 61 - .../gremlin_python/structure/io/graphsonV2d0.py | 13 +- .../gremlin_python/structure/io/graphsonV3d0.py | 13 +- .../src/main/jython/radish/feature_steps.py | 3 +- gremlin-test/features/filter/Has.feature| 57 - .../process/traversal/step/filter/HasTest.java | 86 + 35 files changed, 1061 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/519ca65c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b475c86..554ec2f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. * Removed support for `-i` option in Gremlin Server which was previously deprecated. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/519ca65c/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 6146f9b..da7260c 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3356,24 +3356,32 @@ interface. Steps that allow for this type of modulation will explicitly state so [[a-note-on-predicates]] == A Note on Predicates -A `P` is a predicate of the form `Function`. That is, given some object, return true or false. The -provided predicates are outlined in the table below and are used in various steps such as <>-step, +A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TP` +text predicates extends the `P` predicates, but are specialized in that they are of the form `Function`. +The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. [width="100%",cols="3,15",options="header"]
[18/35] tinkerpop git commit: TINKERPOP-2055 Minor comment fixes
TINKERPOP-2055 Minor comment fixes Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bd7048dd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bd7048dd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bd7048dd Branch: refs/heads/TINKERPOP-2058 Commit: bd7048dda3e9fb20b717412ee708cffc62f2ca41 Parents: a083fbf Author: Stephen Mallette Authored: Thu Oct 4 14:02:08 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:02:19 2018 -0400 -- .../javascript/gremlin-javascript/test/unit/graphson-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd7048dd/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js index a1ac0d6..66a36c6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js @@ -46,7 +46,7 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); - it('should parse GraphSON Nan from GraphSON', function () { + it('should parse GraphSON NaN from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double", @@ -54,7 +54,7 @@ describe('GraphSONReader', function () { }); assert.ok(isNaN(result)); }); - it('should parse GraphSON -Infinity and Nan from GraphSON', function () { + it('should parse GraphSON -Infinity from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double", @@ -62,7 +62,7 @@ describe('GraphSONReader', function () { }); assert.strictEqual(result, Number.NEGATIVE_INFINITY); }); - it('should parse GraphSON Infinity and Nan from GraphSON', function () { + it('should parse GraphSON Infinity from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double",
[27/35] tinkerpop git commit: Moved tests that fail periodically to integration tests.
Moved tests that fail periodically to integration tests. These tests require Grape and external resources to pass. Those resources seem to be less dependable on Travis sometimes and causes test failures. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4bdb006c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4bdb006c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4bdb006c Branch: refs/heads/TINKERPOP-2058 Commit: 4bdb006c5ee418f27ef7bb8a9330714ce414c50f Parents: ca034f1 Author: Stephen Mallette Authored: Fri Oct 5 06:38:42 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 06:53:21 2018 -0400 -- .../jsr223/GremlinGroovyScriptEngineTest.java | 33 ++--- .../GremlinGroovyScriptEngineIntegrateTest.java | 37 2 files changed, 39 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java index 54e997f..2803c24 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java @@ -38,7 +38,8 @@ import javax.script.ScriptContext; import javax.script.ScriptEngine; import javax.script.ScriptException; import javax.script.SimpleBindings; -import java.awt.*; +import java.awt.Color; +import java.awt.SystemColor; import java.io.StringWriter; import java.util.ArrayList; import java.util.Arrays; @@ -266,36 +267,6 @@ public class GremlinGroovyScriptEngineTest { } @Test -public void shouldLoadImportsViaDependencyManagerFromDependencyGatheredByUse() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath"))); -engine.use("org.apache.commons", "commons-math3", "3.2"); -assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)")); -} - -@Test -public void shouldAllowsUseToBeExecutedAfterImport() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.use("org.apache.commons", "commons-math3", "3.2"); -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath"))); -assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)")); -} - -@Test public void shouldAllowsMultipleImports() throws Exception { final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); try { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java index 5242d3b..c595209 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java @@ -18,16 +18,23 @@ */ package org.apache.tinkerpop.gremlin.jsr223; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import
[31/35] tinkerpop git commit: Merge branch 'TINKERPOP-2056' into tp32
Merge branch 'TINKERPOP-2056' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/21059b9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/21059b9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/21059b9b Branch: refs/heads/TINKERPOP-2058 Commit: 21059b9b6b227d6781a6678b60d5c42f25127f6e Parents: 4bdb006 99d836b Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:44 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:44 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
[08/35] tinkerpop git commit: TINKERPOP-2044 Configurable traversal to validate host connectivity.
TINKERPOP-2044 Configurable traversal to validate host connectivity. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b510613b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b510613b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b510613b Branch: refs/heads/TINKERPOP-2058 Commit: b510613b10962a3e8d95c3e590b5f58297227d0e Parents: 88d6f77 Author: Stephen Mallette Authored: Fri Sep 28 15:54:30 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 08:16:44 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index c4523d8..f3340cc 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -39,6 +39,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. +* Added `Cluster` configuration option to set a custom validation script to use to test server connectivity in the Java driver. * Improved ability of `GroovyTranslator` to handle more types supported by GraphSON. * Improved ability of `GroovyTranslator` to handle custom types. * Added better internal processing of `Column` in `by(Function)`. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/docs/src/reference/gremlin-applications.asciidoc -- diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index 1cd9964..5607667 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -750,6 +750,7 @@ The following table describes the various configuration options for the Gremlin |connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false |connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_ |connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_ +|connectionPool.validationRequest |A script that is used to test server connectivity. A good script to use is one that evaluates quickly and returns no data. The default simply returns an empty string, but if a graph is required by a particular provider, a good traversal might be `g.inject()`. |_''_ |hosts |The list of hosts that the driver will connect to. |localhost |jaasEntry |Sets the `AuthProperties.Property.JAAS_ENTRY` properties for authentication to Gremlin Server. |_none_ |nioPoolSize |Size of the pool for handling request/response operations. |available processors http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java -- diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java index 9adaaa1..c090584 100644 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java @@ -25,11 +25,16 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import org.apache.commons.configuration.Configuration; +import org.apache.tinkerpop.gremlin.driver.message.RequestMessage; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import io.netty.bootstrap.Bootstrap; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.apache.tinkerpop.gremlin.process.traversal.Bytecode; +import
[14/35] tinkerpop git commit: Renamed `TP` to `TextP` as proposed by @robertdale
Renamed `TP` to `TextP` as proposed by @robertdale Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f057fb36 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f057fb36 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f057fb36 Branch: refs/heads/TINKERPOP-2058 Commit: f057fb3601ab12dfe8dc10361c9916c904fc5a0d Parents: 79d4a05 Author: Daniel Kuppitz Authored: Mon Oct 1 09:27:35 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 16 +-- docs/src/upgrade/release-3.4.x.asciidoc | 2 +- .../tinkerpop/gremlin/jsr223/CoreImports.java | 6 +- .../tinkerpop/gremlin/process/traversal/TP.java | 107 --- .../gremlin/process/traversal/TextP.java| 107 +++ .../structure/io/graphson/GraphSONModule.java | 10 +- .../io/graphson/TraversalSerializersV2d0.java | 12 +-- .../io/graphson/TraversalSerializersV3d0.java | 12 +-- .../structure/io/gryo/GryoSerializersV1d0.java | 10 +- .../structure/io/gryo/GryoSerializersV3d0.java | 10 +- .../gremlin/structure/io/gryo/GryoVersion.java | 6 +- .../gremlin/process/traversal/PTest.java| 28 ++--- .../GraphSONMapperPartialEmbeddedTypeTest.java | 16 +-- gremlin-dotnet/glv/TP.template | 71 gremlin-dotnet/glv/TextP.template | 71 gremlin-dotnet/glv/generate.groovy | 12 +-- .../src/Gremlin.Net/Process/Traversal/TP.cs | 96 - .../src/Gremlin.Net/Process/Traversal/TextP.cs | 96 + .../Structure/IO/GraphSON/GraphSONWriter.cs | 2 +- .../Structure/IO/GraphSON/TPSerializer.cs | 45 .../Structure/IO/GraphSON/TextPSerializer.cs| 45 .../Gherkin/TraversalEvaluation/TPParameter.cs | 97 - .../TraversalEvaluation/TextPParameter.cs | 97 + .../TraversalEvaluation/TraversalParser.cs | 6 +- .../gremlin/groovy/jsr223/GroovyTranslator.java | 8 +- gremlin-javascript/glv/TraversalSource.template | 6 +- gremlin-javascript/glv/generate.groovy | 6 +- .../main/javascript/gremlin-javascript/index.js | 2 +- .../gremlin-javascript/lib/process/traversal.js | 6 +- .../lib/structure/io/graph-serializer.js| 4 +- .../lib/structure/io/type-serializers.js| 10 +- .../test/cucumber/feature-steps.js | 2 +- gremlin-python/glv/TraversalSource.template | 6 +- gremlin-python/glv/generate.groovy | 6 +- .../gremlin/python/jsr223/PythonTranslator.java | 8 +- .../jython/gremlin_python/process/traversal.py | 26 ++--- .../gremlin_python/structure/io/graphsonV2d0.py | 8 +- .../gremlin_python/structure/io/graphsonV3d0.py | 8 +- .../src/main/jython/radish/feature_steps.py | 4 +- gremlin-test/features/filter/Has.feature| 10 +- .../process/traversal/step/filter/HasTest.java | 12 +-- 41 files changed, 556 insertions(+), 556 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index da7260c..fdd261a 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3357,8 +3357,8 @@ interface. Steps that allow for this type of modulation will explicitly state so == A Note on Predicates A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of -the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TP` -text predicates extends the `P` predicates, but are specialized in that they are of the form `Function`. +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TextP` +text predicates extend the `P` predicates, but are specialized in that they are of the form `Function`. The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. @@ -3376,12 +3376,12 @@ The provided predicates are outlined in the table below and are used in various | `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? | `P.within(objects...)` | Is the incoming object in the array of provided objects? | `P.without(objects...)` | Is the incoming object not in the array of the provided objects? -| `TP.startsWith(string)` | Does the incoming `String` start with the
[35/35] tinkerpop git commit: TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors.
TINKERPOP-2058 Use `Compare.eq` in `Contains.within` to ensure equal filter behaviors. If the object to be filtered is a number, `Contains` predicates will now scan the provided collection, comparing each element using `Compare.eq`. For non-numeric values `Contains.within` will still use `collection.contains()` in order to make use of search-optimized data types (e.g. `Set`). Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1955ddd0 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1955ddd0 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1955ddd0 Branch: refs/heads/TINKERPOP-2058 Commit: 1955ddd0ce2d4736c6152dc91b496590204616f0 Parents: 4778482 Author: Daniel Kuppitz Authored: Thu Oct 4 07:15:09 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:14:12 2018 -0700 -- CHANGELOG.asciidoc | 1 + .../gremlin/process/traversal/Contains.java | 16 +--- .../gremlin/process/traversal/ContainsTest.java | 2 +- .../tinkerpop/gremlin/process/traversal/PTest.java | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1955ddd0/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 14d79aa..739737e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Use `Compare.eq` in `Contains` predicates to ensure the same filter behavior for numberic values. * Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1955ddd0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java index da46d0b..35a8ca7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Contains.java @@ -18,19 +18,27 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; + import java.util.Collection; import java.util.function.BiPredicate; /** * {@link Contains} is a {@link BiPredicate} that evaluates whether the first object is contained within (or not - * within) the second collection object. For example: + * within) the second collection object. If the first object is a number, each element in the second collection + * will be compared to the first object using {@link Compare}'s {@code eq} predicate. This will ensure, that numbers + * are matched by their value only, ignoring the number type. For example: * * * gremlin Contains.within [gremlin, blueprints, furnace] == true * gremlin Contains.without [gremlin, rexster] == false * rexster Contains.without [gremlin, blueprints, furnace] == true + * 123 Contains.within [1, 2, 3] == false + * 100 Contains.within [1L, 10L, 100L] == true * * + * + * * @author Pierre De Wilde * @author Marko A. Rodriguez (http://markorodriguez.com) */ @@ -44,7 +52,9 @@ public enum Contains implements BiPredicate { within { @Override public boolean test(final Object first, final Collection second) { -return second.contains(first); +return first instanceof Number +? IteratorUtils.anyMatch(second.iterator(), o -> Compare.eq.test(first, o)) +: second.contains(first); } }, @@ -56,7 +66,7 @@ public enum Contains implements BiPredicate { without { @Override public boolean test(final Object first, final Collection second) { -return !second.contains(first); +return !within.test(first, second); } }; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1955ddd0/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/ContainsTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/ContainsTest.java
[16/35] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/650d1e84 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/650d1e84 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/650d1e84 Branch: refs/heads/TINKERPOP-2058 Commit: 650d1e84d0b7d6f8a213a67df593c43134e156fe Parents: 2b4c993 b510613 Author: Stephen Mallette Authored: Thu Oct 4 12:11:28 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 12:11:28 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/docs/src/reference/gremlin-applications.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java -- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java index cee1309,c090584..fe1d896 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java @@@ -880,6 -900,28 +891,17 @@@ public final class Cluster } /** + * Specify a valid Gremlin script that can be used to test remote operations. This script should be designed + * to return quickly with the least amount of overhead possible. By default, the script sends an empty string. + * If the graph does not support that sort of script because it requires all scripts to include a reference + * to a graph then a good option might be {@code g.inject()}. + */ + public Builder validationRequest(final String script) { + validationRequest = script; + return this; + } + + /** - * Time in milliseconds to wait before attempting to reconnect to a dead host after it has been marked dead. - * - * @deprecated As of release 3.2.3, the value of the initial delay is now the same as the {@link #reconnectInterval}. - */ -@Deprecated -public Builder reconnectIntialDelay(final int initialDelay) { -this.reconnectInitialDelay = initialDelay; -return this; -} - -/** * Time in milliseconds to wait between retries when attempting to reconnect to a dead host. */ public Builder reconnectInterval(final int interval) { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java -- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java index 37cecb4,c2ae045..61edd86 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java @@@ -409,6 -420,27 +411,11 @@@ final class Settings * {@link org.apache.tinkerpop.gremlin.driver.Channelizer.WebSocketChannelizer}. */ public String channelizer = Channelizer.WebSocketChannelizer.class.getName(); + + /** + * A valid Gremlin script that can be used to test remote operations. + */ + public String validationRequest = "''"; - -/** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ -@Deprecated -public String sessionId = null; - -/** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ -@Deprecated -public Optional
[21/35] tinkerpop git commit: TINKERPOP-2055 Support NaN/Infinity on GraphSON 3.0
TINKERPOP-2055 Support NaN/Infinity on GraphSON 3.0 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5b9b81fd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5b9b81fd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5b9b81fd Branch: refs/heads/TINKERPOP-2058 Commit: 5b9b81fdea9778f777a01aa2a70bc93510f16399 Parents: 28bf304 Author: Stephen Mallette Authored: Thu Oct 4 14:53:04 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:53:04 2018 -0400 -- .../structure/io/graphson/GraphSONModule.java | 2 +- .../io/graphson/GraphSONSerializersV3d0.java| 23 - .../IO/GraphSON/GraphSONReaderTests.cs | 7 +++--- .../IO/GraphSON/GraphSONWriterTests.cs | 2 +- .../gremlin_python/structure/io/graphsonV3d0.py | 26 .../tests/structure/io/test_graphsonV3d0.py | 22 + 6 files changed, 71 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b9b81fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java index 2e795a5..39f1927 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java @@ -254,7 +254,7 @@ abstract class GraphSONModule extends TinkerPopJacksonModule { // numbers addDeserializer(Integer.class, new GraphSONSerializersV3d0.IntegerJackonsDeserializer()); -addDeserializer(Double.class, new GraphSONSerializersV3d0.DoubleJackonsDeserializer()); +addDeserializer(Double.class, new GraphSONSerializersV3d0.DoubleJacksonDeserializer()); // traversal addDeserializer(Bytecode.class, new TraversalSerializersV3d0.BytecodeJacksonDeserializer()); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b9b81fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java index 8c601b1..8d80478 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java @@ -47,11 +47,9 @@ import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException; import org.apache.tinkerpop.shaded.jackson.core.JsonToken; import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext; import org.apache.tinkerpop.shaded.jackson.databind.JavaType; -import org.apache.tinkerpop.shaded.jackson.databind.JsonNode; import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider; import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer; import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer; -import org.apache.tinkerpop.shaded.jackson.databind.node.ArrayNode; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdKeySerializer; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer; @@ -705,15 +703,28 @@ class GraphSONSerializersV3d0 { } } -static class DoubleJackonsDeserializer extends StdDeserializer { +static class DoubleJacksonDeserializer extends StdDeserializer { -protected DoubleJackonsDeserializer() { +protected DoubleJacksonDeserializer() { super(Double.class); } @Override -public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { -return jsonParser.getDoubleValue(); +public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +if (jsonParser.getCurrentToken().isNumeric()) +return jsonParser.getDoubleValue(); +else { +final String numberText = jsonParser.getValueAsString(); +if
[05/35] tinkerpop git commit: TINKERPOP-2055 Updated IO docs to include special numbers
TINKERPOP-2055 Updated IO docs to include special numbers Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a083fbff Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a083fbff Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a083fbff Branch: refs/heads/TINKERPOP-2058 Commit: a083fbff62fcc38a3dae9b138f56b0d052e0c143 Parents: b542027 Author: Stephen Mallette Authored: Wed Oct 3 05:30:27 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 05:30:27 2018 -0400 -- docs/src/dev/io/graphson.asciidoc | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a083fbff/docs/src/dev/io/graphson.asciidoc -- diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index c120634..064ac2e 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -1491,6 +1491,8 @@ types. By default, TinkerPop types will have the namespace "g" (or "gx" for "ext Double +While the `@value` is expected to be a JSON number, it might also be a `String` of `NaN`, `Infinity` or `-Infinity`. + [source,json] {
[24/35] tinkerpop git commit: Merge branch 'pr-948' into tp32
Merge branch 'pr-948' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ca034f12 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ca034f12 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ca034f12 Branch: refs/heads/TINKERPOP-2058 Commit: ca034f12aa2103e2b718ce52859cb51b52c3728a Parents: 80fa89b 48d5d1d Author: Stephen Mallette Authored: Thu Oct 4 16:47:33 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 16:47:33 2018 -0400 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) --
[04/35] tinkerpop git commit: TINKERPOP-2055 Added tests for .Net on special numbers
TINKERPOP-2055 Added tests for .Net on special numbers Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b5420278 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b5420278 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b5420278 Branch: refs/heads/TINKERPOP-2058 Commit: b542027825fe905c0c46b81a00fe7dfd5275e8c6 Parents: 2d3041f Author: Stephen Mallette Authored: Wed Oct 3 05:11:56 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 05:11:56 2018 -0400 -- .../IO/GraphSON/GraphSONReaderTests.cs | 38 ++-- .../IO/GraphSON/GraphSONWriterTests.cs | 30 2 files changed, 66 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5420278/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs index 74bf385..08a91ae 100644 --- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs @@ -24,11 +24,9 @@ using System; using System.Collections.Generic; using System.Numerics; -using Gremlin.Net.Process.Traversal; using Gremlin.Net.Structure; using Gremlin.Net.Structure.IO.GraphSON; using Moq; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Xunit; @@ -178,6 +176,42 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON } [Fact] +public void ShouldDeserializeNaN() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'NaN'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.NaN, deserializedValue); +} + +[Fact] +public void ShouldDeserializePositiveInfinity() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'Infinity'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.PositiveInfinity, deserializedValue); +} + +[Fact] +public void ShouldDeserializeNegativeInfinity() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'-Infinity'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.NegativeInfinity, deserializedValue); +} + +[Fact] public void ShouldDeserializeDecimal() { var serializedValue = "{\"@type\":\"gx:BigDecimal\",\"@value\":-8.201}"; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5420278/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs index a544fb3..13fbddc 100644 --- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs @@ -81,6 +81,36 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON } [Fact] +public void ShouldSerializeNaN() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.NaN); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"NaN\"}", graphSon); +} + +[Fact] +public void ShouldSerializePositiveInfinity() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.PositiveInfinity); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"Infinity\"}", graphSon); +} + +[Fact] +public void ShouldSerializeNegativeInfinity() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.NegativeInfinity); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"-Infinity\"}", graphSon); +} + +
[07/35] tinkerpop git commit: reverts class StarGraphGryoSerializer
reverts class StarGraphGryoSerializer Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/48d5d1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/48d5d1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/48d5d1d4 Branch: refs/heads/TINKERPOP-2058 Commit: 48d5d1d4d33cd1d95354062764858e1a1b4e5d38 Parents: 9e1865a Author: Otavio Santana Authored: Wed Oct 3 15:11:00 2018 -0300 Committer: Otavio Santana Committed: Wed Oct 3 15:11:00 2018 -0300 -- .../gremlin/structure/util/star/StarGraphGryoSerializer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/48d5d1d4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java index 86bbf98..b2379ce 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.structure.util.star; -import java.util.EnumMap; import java.util.HashMap; import java.util.Map; @@ -35,7 +34,7 @@ import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.shaded.ShadedSeri */ public final class StarGraphGryoSerializer extends ShadedSerializerAdapter { -private static final Map CACHE = new EnumMap<>(Direction.class); +private static final Map CACHE = new HashMap<>(); static { CACHE.put(Direction.BOTH, new StarGraphGryoSerializer(Direction.BOTH));
[23/35] tinkerpop git commit: TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates.
TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/99d836b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/99d836b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/99d836b3 Branch: refs/heads/TINKERPOP-2058 Commit: 99d836b357c6036d7f0c175537f0d1d8720fecdf Parents: fcbce50 Author: Daniel Kuppitz Authored: Thu Oct 4 07:07:27 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 13:00:35 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/99d836b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 7d0d071..4b9063f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; -import java.math.BigDecimal; import java.util.function.BiPredicate; /** @@ -28,14 +27,13 @@ import java.util.function.BiPredicate; * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com) * @author Matt Frantz (http://github.com/mhfrantz) + * @author Daniel Kuppitz (http://gemlin.guru) */ public enum Compare implements BiPredicate { + /** - * Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -43,8 +41,7 @@ public enum Compare implements BiPredicate { @Override public boolean test(final Object first, final Object second) { return null == first ? null == second : (first instanceof Number && second instanceof Number -&& !first.getClass().equals(second.getClass()) -? big((Number) first).compareTo(big((Number) second)) == 0 +? NumberHelper.compare((Number) first, (Number) second) == 0 : first.equals(second)); } @@ -58,11 +55,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is not equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -82,11 +76,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare - * operations to be a bit more forgiving with respect to comparing different number
[22/35] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e330ad67 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e330ad67 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e330ad67 Branch: refs/heads/TINKERPOP-2058 Commit: e330ad67d142316276624617015d3cc477c1ecad Parents: 9e40789 5b9b81f Author: Stephen Mallette Authored: Thu Oct 4 14:53:46 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:53:46 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../structure/io/graphson/GraphSONModule.java | 2 +- .../io/graphson/GraphSONSerializersV2d0.java| 19 ++-- .../io/graphson/GraphSONSerializersV3d0.java| 23 +++--- .../GraphSONMapperEmbeddedTypeTest.java | 14 ++ .../IO/GraphSON/GraphSONReaderTests.cs | 48 +--- .../IO/GraphSON/GraphSONWriterTests.cs | 32 - .../lib/structure/io/type-serializers.js| 30 +++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphsonV2d0.py | 26 +++ .../gremlin_python/structure/io/graphsonV3d0.py | 26 +++ .../tests/structure/io/test_graphsonV2d0.py | 25 ++ .../tests/structure/io/test_graphsonV3d0.py | 22 + 14 files changed, 290 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/docs/src/dev/io/graphson.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py --
[33/35] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/77c7a4f8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/77c7a4f8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/77c7a4f8 Branch: refs/heads/TINKERPOP-2058 Commit: 77c7a4f87e763b0e5e8ffa900b04a624ef16975c Parents: 813ab73 02e0b8b Author: Daniel Kuppitz Authored: Fri Oct 5 10:00:15 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:00:15 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/77c7a4f8/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PTest.java --
[28/35] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d9ccefce Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d9ccefce Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d9ccefce Branch: refs/heads/TINKERPOP-2058 Commit: d9ccefcea9274f00e7339b840624286e198d7832 Parents: 86b1be5 4bdb006 Author: Stephen Mallette Authored: Fri Oct 5 06:57:09 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 06:57:09 2018 -0400 -- .../groovy/jsr223/GremlinGroovyScriptEngineTest.java | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ccefce/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java -- diff --cc gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java index 3e1d153,2803c24..83ac13d --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java @@@ -22,13 -22,16 +22,9 @@@ import groovy.lang.Closure import groovy.lang.MissingPropertyException; import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; -import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.InterpreterModeCustomizerProvider; --import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.util.function.Lambda; --import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import org.javatuples.Pair; import org.junit.Test; --import org.slf4j.Logger; --import org.slf4j.LoggerFactory; import javax.script.Bindings; import javax.script.ScriptContext; @@@ -61,8 -73,8 +57,6 @@@ import static org.junit.Assert.fail * @author Stephen Mallette (http://stephen.genoprime.com) */ public class GremlinGroovyScriptEngineTest { --private static final Logger logger = LoggerFactory.getLogger(GremlinGroovyScriptEngineTest.class); -- private static final Object[] EMPTY_ARGS = new Object[0]; @Test @@@ -162,8 -220,78 +156,7 @@@ engine.eval("assert 1==0"); } - @Test -public void shouldLoadImportsViaDependencyManagerInterface() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("Vertex.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.tinkerpop.gremlin.structure.Vertex"))); -assertEquals(Vertex.class.getName(), engine.eval("Vertex.class.getName()")); -} - -@Test -public void shouldLoadImportsViaDependencyManagerInterfaceAdditively() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("Vertex.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -try { -engine.eval("StreamFactory.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import " + Vertex.class.getCanonicalName(; -assertEquals(Vertex.class.getName(), engine.eval("Vertex.class.getName()")); - -try { -engine.eval("IteratorUtils.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import " + IteratorUtils.class.getCanonicalName(; -
[34/35] tinkerpop git commit: Update NOTICE with the currently used version of Groovy CTR
Update NOTICE with the currently used version of Groovy CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47784823 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47784823 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47784823 Branch: refs/heads/TINKERPOP-2058 Commit: 47784823d7e8f42da9ddb684dd1b0a12cc25e8a4 Parents: 77c7a4f Author: Stephen Mallette Authored: Fri Oct 5 13:02:35 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 13:03:06 2018 -0400 -- gremlin-console/src/main/static/NOTICE | 2 +- gremlin-server/src/main/static/NOTICE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47784823/gremlin-console/src/main/static/NOTICE -- diff --git a/gremlin-console/src/main/static/NOTICE b/gremlin-console/src/main/static/NOTICE index 593d16b..c989c58 100644 --- a/gremlin-console/src/main/static/NOTICE +++ b/gremlin-console/src/main/static/NOTICE @@ -18,7 +18,7 @@ This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) -Apache Groovy 2.4.15 (AL ASF) +Apache Groovy 2.5.2 (AL ASF) This product includes/uses ANTLR (http://www.antlr2.org/) developed by Terence Parr 1989-2006 http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47784823/gremlin-server/src/main/static/NOTICE -- diff --git a/gremlin-server/src/main/static/NOTICE b/gremlin-server/src/main/static/NOTICE index 68e628c..4fc9c71 100644 --- a/gremlin-server/src/main/static/NOTICE +++ b/gremlin-server/src/main/static/NOTICE @@ -11,7 +11,7 @@ This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) -Apache Groovy 2.4.15 (AL ASF) +Apache Groovy 2.5.2 (AL ASF) This product includes/uses ANTLR (http://www.antlr2.org/) developed by Terence Parr 1989-2006
[26/35] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d69efd5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d69efd5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d69efd5 Branch: refs/heads/TINKERPOP-2058 Commit: 2d69efd50373835a2962c48b42f6b81935d24152 Parents: e330ad6 86b1be5 Author: Stephen Mallette Authored: Thu Oct 4 16:47:56 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 16:47:56 2018 -0400 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) --
[32/35] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/02e0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/02e0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/02e0b8b3 Branch: refs/heads/TINKERPOP-2058 Commit: 02e0b8b33c6698cefa62d03f237f5dbe0b1ab9e3 Parents: d9ccefc 21059b9 Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:58 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:58 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
[20/35] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28bf3046 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28bf3046 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28bf3046 Branch: refs/heads/TINKERPOP-2058 Commit: 28bf30468cca9bbd5c95b3814619801348cfad96 Parents: 650d1e8 80fa89b Author: Stephen Mallette Authored: Thu Oct 4 14:10:54 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:10:54 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../io/graphson/GraphSONSerializersV2d0.java| 19 ++-- .../GraphSONMapperEmbeddedTypeTest.java | 14 ++ .../IO/GraphSON/GraphSONReaderTests.cs | 49 +--- .../IO/GraphSON/GraphSONWriterTests.cs | 32 - .../lib/structure/io/type-serializers.js| 30 +++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphsonV2d0.py | 26 +++ .../tests/structure/io/test_graphsonV2d0.py | 25 ++ 10 files changed, 224 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/docs/src/dev/io/graphson.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java -- diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java index a375e3b,e5f2693..c9400cd --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java @@@ -44,16 -44,8 +44,17 @@@ import java.time.ZoneOffset import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Map; +import java.util.Set; +import static org.hamcrest.CoreMatchers.any; +import static org.hamcrest.Matchers.either; ++import static org.hamcrest.core.IsNot.not; import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeThat; @@@ -85,58 -74,21 +86,71 @@@ public class GraphSONMapperEmbeddedType public String version; @Test + public void shouldHandleNumberConstants() throws Exception { -assumeThat(version, startsWith("v2")); ++assumeThat(version, not(startsWith("v1"))); + + final List o = new ArrayList<>(); + o.add(123.321d); + o.add(Double.NaN); + o.add(Double.NEGATIVE_INFINITY); + o.add(Double.POSITIVE_INFINITY); + + assertEquals(o, serializeDeserialize(mapper, o, List.class)); + } + + @Test +public void shouldHandleMap() throws Exception { +assumeThat(version, startsWith("v3")); + +final Map o = new LinkedHashMap<>(); +o.put("string key", "string value"); +o.put(1, 1); +o.put(1L, 1L); + +final List l = Arrays.asList("test", 1, 5L); +o.put(l, "crazy"); + +assertEquals(o, serializeDeserialize(mapper, o, Map.class)); +} + +@Test +public void shouldHandleList() throws Exception { +assumeThat(version, startsWith("v3")); + +final List o = new ArrayList<>(); +o.add("test"); +o.add(1); +o.add(1); +o.add(1L); +o.add(1L); + +final List l = Arrays.asList("test", 1, 5L); +o.add(l); + +assertEquals(o, serializeDeserialize(mapper, o, List.class)); +}
[09/35] tinkerpop git commit: TINKERPOP-2041 Added IO tests for TextP
TINKERPOP-2041 Added IO tests for TextP Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8b69b34b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8b69b34b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8b69b34b Branch: refs/heads/TINKERPOP-2058 Commit: 8b69b34b6393a3071c0cd491ea9ec0ca09a1e5ae Parents: 9b96586 Author: Stephen Mallette Authored: Wed Oct 3 15:01:40 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/dev/io/graphson.asciidoc | 26 .../scripts/generate-graphson-resources.groovy | 12 - .../tinkerpop/gremlin/structure/io/Model.java | 9 +++ .../io/AbstractTypedCompatibilityTest.java | 14 +++ .../io/graphson/_3_4_0/textp-v2d0-partial.json | 7 ++ .../io/graphson/_3_4_0/textp-v3d0.json | 7 ++ .../structure/io/gryo/_3_4_0/textp-v1d0.kryo| 1 + .../structure/io/gryo/_3_4_0/textp-v3d0.kryo| 1 + 8 files changed, 71 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8b69b34b/docs/src/dev/io/graphson.asciidoc -- diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index d140a2f..1c9081c 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -3014,6 +3014,19 @@ The following `Bytecode` example represents the traversal of `g.V().hasLabel('pe } + TextP + +[source,json] + +{ + "@type" : "g:TextP", + "@value" : { +"predicate" : "containing", +"value" : "ark" + } +} + + TraversalMetrics [source,json] @@ -5392,6 +5405,19 @@ Please see <<_p,P>> for additional information on `within`. } + TextP + +[source,json] + +{ + "@type" : "g:TextP", + "@value" : { +"predicate" : "containing", +"value" : "ark" + } +} + + TraversalMetrics [source,json] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8b69b34b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy -- diff --git a/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy index 55b4fa6..03112ed 100644 --- a/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy +++ b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy @@ -59,19 +59,19 @@ toJson = { o, type, mapper, comment = "", suffix = "" -> writeSupportedV1Objects = { writer, mapper -> writer.write("=== Graph Structure\n\n") -model.entries("Graph Structure").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { +model.entries("Graph Structure").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } writer.write("\n") writer.write("=== RequestMessage\n\n") - model.entries("RequestMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { + model.entries("RequestMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } writer.write("\n") writer.write("=== ResponseMessage\n\n") - model.entries("ResponseMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { + model.entries("ResponseMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } } @@ -156,7 +156,7 @@ mapper = GraphSONMapper.build(). file = new File("${projectBuildDir}/dev-docs/out-graphson-2d0-partial.txt") if (file.exists()) file.delete() -file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0PartialTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_PARTIAL_3_3_1)}, v2ExtendedDescription) } +file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0PartialTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_PARTIAL_3_4_0)}, v2ExtendedDescription) } mapper = GraphSONMapper.build(). addRegistry(TinkerIoRegistryV2d0.instance()). @@ -167,7 +167,7 @@ mapper = GraphSONMapper.build(). file = new File("${projectBuildDir}/dev-docs/out-graphson-2d0-no-type.txt") if (file.exists()) file.delete() -file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0NoTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_NO_TYPE_3_3_1)}, v2ExtendedDescription) }
[29/35] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/73444c32 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/73444c32 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/73444c32 Branch: refs/heads/TINKERPOP-2058 Commit: 73444c321dfebf6b10e516b8f7c39c6039c5a3f6 Parents: 2d69efd d9ccefc Author: Stephen Mallette Authored: Fri Oct 5 07:02:40 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 07:02:40 2018 -0400 -- .../groovy/jsr223/GremlinGroovyScriptEngineTest.java | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) --
[17/35] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9e407898 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9e407898 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9e407898 Branch: refs/heads/TINKERPOP-2058 Commit: 9e4078983bb41a66f17cd33d599168a8ec78295b Parents: 8b69b34 650d1e8 Author: Stephen Mallette Authored: Thu Oct 4 12:12:02 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 12:12:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/docs/src/reference/gremlin-applications.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java --
[03/35] tinkerpop git commit: TINKERPOP-2055 Added special number handling in javascript
TINKERPOP-2055 Added special number handling in javascript Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d3041f2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d3041f2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d3041f2 Branch: refs/heads/TINKERPOP-2058 Commit: 2d3041f226310379c966214461c79cf47432f4c9 Parents: 854914e Author: Stephen Mallette Authored: Wed Oct 3 04:33:40 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 04:33:40 2018 -0400 -- .../lib/structure/io/type-serializers.js| 30 ++- .../test/unit/graphson-test.js | 39 2 files changed, 67 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d3041f2/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js index fdf049f..5583c47 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js @@ -49,11 +49,37 @@ class TypeSerializer { class NumberSerializer extends TypeSerializer { serialize(item) { -return item; +if (isNaN(item)) { + return { +[typeKey]: 'g:Double', +[valueKey]: 'NaN' + }; +} else if (item === Number.POSITIVE_INFINITY) { + return { +[typeKey]: 'g:Double', +[valueKey]: 'Infinity' + }; +} else if (item === Number.NEGATIVE_INFINITY) { + return { +[typeKey]: 'g:Double', +[valueKey]: '-Infinity' + }; +} else { + return item; +} } deserialize(obj) { -return parseFloat(obj[valueKey]); +var val = obj[valueKey]; +if (val === 'NaN') { + return NaN; +} else if (val === 'Infinity') { + return Number.POSITIVE_INFINITY; +} else if (val === '-Infinity') { + return Number.NEGATIVE_INFINITY; +} else { + return parseFloat(val); +} } canBeUsedFor(value) { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d3041f2/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js index b459407..a1ac0d6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js @@ -46,6 +46,30 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); + it('should parse GraphSON Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "NaN" + }); + assert.ok(isNaN(result)); + }); + it('should parse GraphSON -Infinity and Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "-Infinity" + }); + assert.strictEqual(result, Number.NEGATIVE_INFINITY); + }); + it('should parse GraphSON Infinity and Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "Infinity" + }); + assert.strictEqual(result, Number.POSITIVE_INFINITY); + }); it('should parse Date', function() { const obj = { "@type" : "g:Date", "@value" : 1481750076295 }; const reader = new GraphSONReader(); @@ -102,6 +126,21 @@ describe('GraphSONWriter', function () { const writer = new GraphSONWriter(); assert.strictEqual(writer.write(2), '2'); }); + it('should write NaN', function () { +const writer = new GraphSONWriter(); +const expected = JSON.stringify({ "@type" : "g:Double", "@value" : "NaN" }); +assert.strictEqual(writer.write(NaN), expected); + }); + it('should write Infinity', function () { +const writer = new GraphSONWriter(); +const expected = JSON.stringify({ "@type" : "g:Double", "@value" : "Infinity" }); +assert.strictEqual(writer.write(Number.POSITIVE_INFINITY), expected); + }); + it('should write
[02/35] tinkerpop git commit: TINKERPOP-2055 Support for special numbers in python
TINKERPOP-2055 Support for special numbers in python Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/854914e6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/854914e6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/854914e6 Branch: refs/heads/TINKERPOP-2058 Commit: 854914e6e3adbf7f0854eb0fec0c3a38b61d4644 Parents: afc12bd Author: Stephen Mallette Authored: Tue Oct 2 16:55:50 2018 -0400 Committer: Stephen Mallette Committed: Tue Oct 2 16:55:50 2018 -0400 -- .../gremlin_python/structure/io/graphson.py | 26 .../jython/tests/structure/io/test_graphson.py | 25 +++ 2 files changed, 51 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/854914e6/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 24e86bb..f3411ba 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 @@ -20,6 +20,7 @@ import datetime import json import time import uuid +import math from collections import OrderedDict import six @@ -381,6 +382,31 @@ class FloatIO(_NumberIO): graphson_type = "g:Float" graphson_base_type = "Float" +@classmethod +def dictify(cls, n, writer): +if isinstance(n, bool): # because isinstance(False, int) and isinstance(True, int) +return n +elif math.isnan(n): +return GraphSONUtil.typedValue(cls.graphson_base_type, "NaN") +elif math.isinf(n) and n > 0: +return GraphSONUtil.typedValue(cls.graphson_base_type, "Infinity") +elif math.isinf(n) and n < 0: +return GraphSONUtil.typedValue(cls.graphson_base_type, "-Infinity") +else: +return GraphSONUtil.typedValue(cls.graphson_base_type, n) + +@classmethod +def objectify(cls, v, _): +if isinstance(v, str): +if v == 'NaN': +return float('nan') +elif v == "Infinity": +return float('inf') +elif v == "-Infinity": +return float('-inf') + +return cls.python_type(v) + class DoubleIO(FloatIO): graphson_type = "g:Double" http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/854914e6/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py -- diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py index 928b33f..37e99c6 100644 --- a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py +++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py @@ -22,6 +22,7 @@ import datetime import time import json import uuid +import math from mock import Mock @@ -70,6 +71,27 @@ class TestGraphSONReader(object): })) assert isinstance(x, float) assert 31.2 == x +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "NaN" +})) +assert isinstance(x, float) +assert math.isnan(x) +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "Infinity" +})) +assert isinstance(x, float) +assert math.isinf(x) and x > 0 +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "-Infinity" +})) +assert isinstance(x, float) +assert math.isinf(x) and x < 0 def test_graph(self): vertex = self.graphson_reader.readObject( @@ -163,6 +185,9 @@ class TestGraphSONWriter(object): assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2))) assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1)) assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2)) +assert {"@type": "g:Double", "@value": "NaN"} == json.loads(self.graphson_writer.writeObject(float('nan'))) +assert {"@type": "g:Double", "@value": "Infinity"} == json.loads(self.graphson_writer.writeObject(float('inf'))) +assert {"@type": "g:Double", "@value": "-Infinity"} == json.loads(self.graphson_writer.writeObject(float('-inf'))) assert """true""" ==
[01/35] tinkerpop git commit: TINKERPOP-2055 Added support for special Double values [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-2058 ec0d8805f -> 1955ddd0c (forced update) TINKERPOP-2055 Added support for special Double values Includes Nan and the infinity values. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/afc12bd2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/afc12bd2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/afc12bd2 Branch: refs/heads/TINKERPOP-2058 Commit: afc12bd27bc9c4c26b3ba2594c4c0810d5d76421 Parents: e7af98b Author: Stephen Mallette Authored: Tue Oct 2 15:35:53 2018 -0400 Committer: Stephen Mallette Committed: Tue Oct 2 15:35:53 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/GraphSONSerializersV2d0.java | 19 --- .../graphson/GraphSONMapperEmbeddedTypeTest.java | 15 +++ 3 files changed, 32 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e93c1c9..33d35d3 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -37,6 +37,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Added support for GraphSON serialization of `Date` in Javascript. * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. +* Added support for `Double.NaN`, `Double.POSITIVE_INFINITY` and `Double.NEGATIVE_INFINITY`. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. * Added better internal processing of `Column` in `by(Function)`. * Added `hasNext()` support on `Traversal` for `gremlin-python`. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java index 2ddb37a..177e2d0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java @@ -677,7 +677,7 @@ class GraphSONSerializersV2d0 { } @Override -public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +public Integer deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { return jsonParser.getIntValue(); } @@ -694,8 +694,21 @@ class GraphSONSerializersV2d0 { } @Override -public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { -return jsonParser.getDoubleValue(); +public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +if (jsonParser.getCurrentToken().isNumeric()) +return jsonParser.getDoubleValue(); +else { +final String numberText = jsonParser.getValueAsString(); +if ("NaN".equalsIgnoreCase(numberText)) +return Double.NaN; +else if ("-Infinity".equals(numberText) || "-INF".equalsIgnoreCase(numberText)) +return Double.NEGATIVE_INFINITY; +else if ("Infinity".equals(numberText) || "INF".equals(numberText)) +return Double.POSITIVE_INFINITY; +else +throw new IllegalStateException("Double value unexpected: " + numberText); +} + } @Override http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java index 9079c8a..e5f2693 100644 ---
[06/35] tinkerpop git commit: Optimazes Map with enum using the EnumMap implementation
Optimazes Map with enum using the EnumMap implementation Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9e1865a9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9e1865a9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9e1865a9 Branch: refs/heads/TINKERPOP-2058 Commit: 9e1865a98d9350451d29dc837e053109d714d7e3 Parents: fcbce50 Author: Otavio Santana Authored: Wed Oct 3 14:17:07 2018 -0300 Committer: Otavio Santana Committed: Wed Oct 3 14:17:07 2018 -0300 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- .../gremlin/structure/util/star/StarGraphGryoSerializer.java| 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java index 3718d16..65d74d2 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java @@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import java.io.Serializable; import java.util.Collections; +import java.util.EnumMap; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -80,7 +81,7 @@ public final class GraphFilter implements Cloneable, Serializable { private Traversal.Admin vertexFilter = null; private Traversal.Admin edgeFilter = null; -private Map> edgeLegality = new HashMap<>(); +private Map> edgeLegality = new EnumMap<>(Direction.class); private boolean allowNoEdges = false; public GraphFilter() { @@ -118,7 +119,7 @@ public final class GraphFilter implements Cloneable, Serializable { throw GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(edgeFilter); this.edgeFilter = edgeFilter.asAdmin().clone(); -this.edgeLegality = new HashMap<>(); +this.edgeLegality = new EnumMap<>(Direction.class); this.edgeLegality.put(Direction.OUT, new HashMap<>()); this.edgeLegality.put(Direction.IN, new HashMap<>()); this.edgeLegality.put(Direction.BOTH, new HashMap<>()); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java index c32777b..cc0e6b4 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java @@ -39,7 +39,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; import java.util.Collections; -import java.util.HashMap; +import java.util.EnumMap; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -77,7 +77,7 @@ public final class GraphFilterStrategy extends AbstractTraversalStrategy> directionLabels = new HashMap<>(); +final Map> directionLabels = new EnumMap<>(Direction.class); final Set outLabels = new HashSet<>(); final Set inLabels = new HashSet<>(); final Set bothLabels = new HashSet<>(); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java index b2379ce..86bbf98 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java +++
[19/35] tinkerpop git commit: Merge branch 'TINKERPOP-2055' into tp32
Merge branch 'TINKERPOP-2055' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/80fa89bd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/80fa89bd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/80fa89bd Branch: refs/heads/TINKERPOP-2058 Commit: 80fa89bdff687f4dcd3c48965be7cb9478fadccc Parents: b510613 bd7048d Author: Stephen Mallette Authored: Thu Oct 4 14:03:44 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:03:44 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../io/graphson/GraphSONSerializersV2d0.java| 19 -- .../GraphSONMapperEmbeddedTypeTest.java | 15 .../IO/GraphSON/GraphSONReaderTests.cs | 38 ++- .../IO/GraphSON/GraphSONWriterTests.cs | 30 +++ .../lib/structure/io/type-serializers.js| 30 ++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphson.py | 26 + .../jython/tests/structure/io/test_graphson.py | 25 + 10 files changed, 218 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/80fa89bd/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index f3340cc,33d35d3..a7e6388 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -38,10 -37,8 +38,11 @@@ image::https://raw.githubusercontent.co * Added support for GraphSON serialization of `Date` in Javascript. * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. + * Added support for `Double.NaN`, `Double.POSITIVE_INFINITY` and `Double.NEGATIVE_INFINITY`. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. +* Added `Cluster` configuration option to set a custom validation script to use to test server connectivity in the Java driver. +* Improved ability of `GroovyTranslator` to handle more types supported by GraphSON. +* Improved ability of `GroovyTranslator` to handle custom types. * Added better internal processing of `Column` in `by(Function)`. * Added `hasNext()` support on `Traversal` for `gremlin-python`. * Added support for additional extended types in Gremlin.Net with `decimal`, `TimeSpan`, `BigInteger`, `byte`, `byte[]`, `char` and `short`.
[13/35] tinkerpop git commit: Renamed `TP` to `TextP` as proposed by @robertdale
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py -- diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py index 266e23d..2d32d47 100644 --- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py +++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py @@ -27,7 +27,7 @@ from aenum import Enum from gremlin_python import statics from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType, DictType, ListType, SetType -from gremlin_python.process.traversal import Binding, Bytecode, P, TP, Traversal, Traverser, TraversalStrategy, T +from gremlin_python.process.traversal import Binding, Bytecode, P, TextP, Traversal, Traverser, TraversalStrategy, T from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path # When we fall back to a superclass's serializer, we iterate over this map. @@ -284,15 +284,15 @@ class PSerializer(_GraphSONTypeIO): return GraphSONUtil.typedValue("P", out) -class TPSerializer(_GraphSONTypeIO): -python_type = TP +class TextPSerializer(_GraphSONTypeIO): +python_type = TextP @classmethod def dictify(cls, p, writer): out = {"predicate": p.operator, "value": [writer.toDict(p.value), writer.toDict(p.other)] if p.other is not None else writer.toDict(p.value)} -return GraphSONUtil.typedValue("TP", out) +return GraphSONUtil.typedValue("TextP", out) class BindingSerializer(_GraphSONTypeIO): http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-python/src/main/jython/radish/feature_steps.py -- diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py index 151d6d5..4777ef3 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -21,7 +21,7 @@ import json import re from gremlin_python.structure.graph import Graph, Path from gremlin_python.process.graph_traversal import __ -from gremlin_python.process.traversal import Barrier, Cardinality, P, TP, Pop, Scope, Column, Order, Direction, T, Pick, Operator, IO +from gremlin_python.process.traversal import Barrier, Cardinality, P, TextP, Pop, Scope, Column, Order, Direction, T, Pick, Operator, IO from radish import given, when, then from hamcrest import * @@ -256,7 +256,7 @@ def _make_traversal(g, traversal_string, params): "Direction": Direction, "Order": Order, "P": P, - "TP": TP, + "TextP": TextP, "IO": IO, "Pick": Pick, "Pop": Pop, http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-test/features/filter/Has.feature -- diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature index 9d2bf4f..e272c05 100644 --- a/gremlin-test/features/filter/Has.feature +++ b/gremlin-test/features/filter/Has.feature @@ -563,7 +563,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.contains("ark")) + g.V().has("name", TextP.contains("ark")) """ When iterated to list Then the result should be unordered @@ -574,7 +574,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.startsWith("mar")) + g.V().has("name", TextP.startsWith("mar")) """ When iterated to list Then the result should be unordered @@ -585,7 +585,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.endsWith("as")) + g.V().has("name", TextP.endsWith("as")) """ When iterated to list Then the result should be unordered @@ -596,7 +596,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("person", "name", TP.contains("o").and(P.lt("m"))) + g.V().has("person", "name", TextP.contains("o").and(P.lt("m"))) """ When iterated to list Then the result should be unordered @@ -607,7 +607,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", P.gt("m").and(TP.contains("o"))) + g.V().has("name", P.gt("m").and(TextP.contains("o"))) """ When iterated to list Then the result should be unordered
[1/2] tinkerpop git commit: TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates.
Repository: tinkerpop Updated Branches: refs/heads/tp32 4bdb006c5 -> 21059b9b6 TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/99d836b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/99d836b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/99d836b3 Branch: refs/heads/tp32 Commit: 99d836b357c6036d7f0c175537f0d1d8720fecdf Parents: fcbce50 Author: Daniel Kuppitz Authored: Thu Oct 4 07:07:27 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 13:00:35 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/99d836b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 7d0d071..4b9063f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; -import java.math.BigDecimal; import java.util.function.BiPredicate; /** @@ -28,14 +27,13 @@ import java.util.function.BiPredicate; * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com) * @author Matt Frantz (http://github.com/mhfrantz) + * @author Daniel Kuppitz (http://gemlin.guru) */ public enum Compare implements BiPredicate { + /** - * Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -43,8 +41,7 @@ public enum Compare implements BiPredicate { @Override public boolean test(final Object first, final Object second) { return null == first ? null == second : (first instanceof Number && second instanceof Number -&& !first.getClass().equals(second.getClass()) -? big((Number) first).compareTo(big((Number) second)) == 0 +? NumberHelper.compare((Number) first, (Number) second) == 0 : first.equals(second)); } @@ -58,11 +55,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is not equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -82,11 +76,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare - * operations
[2/2] tinkerpop git commit: Merge branch 'TINKERPOP-2056' into tp32
Merge branch 'TINKERPOP-2056' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/21059b9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/21059b9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/21059b9b Branch: refs/heads/tp32 Commit: 21059b9b6b227d6781a6678b60d5c42f25127f6e Parents: 4bdb006 99d836b Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:44 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:44 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
tinkerpop git commit: Update NOTICE with the currently used version of Groovy CTR
Repository: tinkerpop Updated Branches: refs/heads/master 77c7a4f87 -> 47784823d Update NOTICE with the currently used version of Groovy CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47784823 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47784823 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47784823 Branch: refs/heads/master Commit: 47784823d7e8f42da9ddb684dd1b0a12cc25e8a4 Parents: 77c7a4f Author: Stephen Mallette Authored: Fri Oct 5 13:02:35 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 13:03:06 2018 -0400 -- gremlin-console/src/main/static/NOTICE | 2 +- gremlin-server/src/main/static/NOTICE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47784823/gremlin-console/src/main/static/NOTICE -- diff --git a/gremlin-console/src/main/static/NOTICE b/gremlin-console/src/main/static/NOTICE index 593d16b..c989c58 100644 --- a/gremlin-console/src/main/static/NOTICE +++ b/gremlin-console/src/main/static/NOTICE @@ -18,7 +18,7 @@ This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) -Apache Groovy 2.4.15 (AL ASF) +Apache Groovy 2.5.2 (AL ASF) This product includes/uses ANTLR (http://www.antlr2.org/) developed by Terence Parr 1989-2006 http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47784823/gremlin-server/src/main/static/NOTICE -- diff --git a/gremlin-server/src/main/static/NOTICE b/gremlin-server/src/main/static/NOTICE index 68e628c..4fc9c71 100644 --- a/gremlin-server/src/main/static/NOTICE +++ b/gremlin-server/src/main/static/NOTICE @@ -11,7 +11,7 @@ This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) -Apache Groovy 2.4.15 (AL ASF) +Apache Groovy 2.5.2 (AL ASF) This product includes/uses ANTLR (http://www.antlr2.org/) developed by Terence Parr 1989-2006
[3/3] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/02e0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/02e0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/02e0b8b3 Branch: refs/heads/tp33 Commit: 02e0b8b33c6698cefa62d03f237f5dbe0b1ab9e3 Parents: d9ccefc 21059b9 Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:58 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:58 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
[1/3] tinkerpop git commit: TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates.
Repository: tinkerpop Updated Branches: refs/heads/tp33 d9ccefcea -> 02e0b8b33 TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/99d836b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/99d836b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/99d836b3 Branch: refs/heads/tp33 Commit: 99d836b357c6036d7f0c175537f0d1d8720fecdf Parents: fcbce50 Author: Daniel Kuppitz Authored: Thu Oct 4 07:07:27 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 13:00:35 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/99d836b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 7d0d071..4b9063f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; -import java.math.BigDecimal; import java.util.function.BiPredicate; /** @@ -28,14 +27,13 @@ import java.util.function.BiPredicate; * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com) * @author Matt Frantz (http://github.com/mhfrantz) + * @author Daniel Kuppitz (http://gemlin.guru) */ public enum Compare implements BiPredicate { + /** - * Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -43,8 +41,7 @@ public enum Compare implements BiPredicate { @Override public boolean test(final Object first, final Object second) { return null == first ? null == second : (first instanceof Number && second instanceof Number -&& !first.getClass().equals(second.getClass()) -? big((Number) first).compareTo(big((Number) second)) == 0 +? NumberHelper.compare((Number) first, (Number) second) == 0 : first.equals(second)); } @@ -58,11 +55,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is not equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -82,11 +76,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare - * operations
[2/3] tinkerpop git commit: Merge branch 'TINKERPOP-2056' into tp32
Merge branch 'TINKERPOP-2056' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/21059b9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/21059b9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/21059b9b Branch: refs/heads/tp33 Commit: 21059b9b6b227d6781a6678b60d5c42f25127f6e Parents: 4bdb006 99d836b Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:44 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:44 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
[2/4] tinkerpop git commit: Merge branch 'TINKERPOP-2056' into tp32
Merge branch 'TINKERPOP-2056' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/21059b9b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/21059b9b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/21059b9b Branch: refs/heads/master Commit: 21059b9b6b227d6781a6678b60d5c42f25127f6e Parents: 4bdb006 99d836b Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:44 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:44 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
[4/4] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/77c7a4f8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/77c7a4f8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/77c7a4f8 Branch: refs/heads/master Commit: 77c7a4f87e763b0e5e8ffa900b04a624ef16975c Parents: 813ab73 02e0b8b Author: Daniel Kuppitz Authored: Fri Oct 5 10:00:15 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 10:00:15 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/77c7a4f8/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/PTest.java --
[1/4] tinkerpop git commit: TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates.
Repository: tinkerpop Updated Branches: refs/heads/master 813ab73e6 -> 77c7a4f87 TINKERPOP-2056 Made use of `NumberHelper` in `Compare` predicates. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/99d836b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/99d836b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/99d836b3 Branch: refs/heads/master Commit: 99d836b357c6036d7f0c175537f0d1d8720fecdf Parents: fcbce50 Author: Daniel Kuppitz Authored: Thu Oct 4 07:07:27 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 13:00:35 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/99d836b3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java index 7d0d071..4b9063f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.process.traversal; -import java.math.BigDecimal; import java.util.function.BiPredicate; /** @@ -28,14 +27,13 @@ import java.util.function.BiPredicate; * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com) * @author Matt Frantz (http://github.com/mhfrantz) + * @author Daniel Kuppitz (http://gemlin.guru) */ public enum Compare implements BiPredicate { + /** - * Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -43,8 +41,7 @@ public enum Compare implements BiPredicate { @Override public boolean test(final Object first, final Object second) { return null == first ? null == second : (first instanceof Number && second instanceof Number -&& !first.getClass().equals(second.getClass()) -? big((Number) first).compareTo(big((Number) second)) == 0 +? NumberHelper.compare((Number) first, (Number) second) == 0 : first.equals(second)); } @@ -58,11 +55,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}. Otherwise they are evaluated - * via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare - * operations to be a bit more forgiving with respect to comparing different number types. + * Evaluates if the first object is not equal to the second. If both are of type {@link Number}, {@link NumberHelper} + * will be used for the comparison, thus enabling the comparison of only values, ignoring the number types. * * @since 3.0.0-incubating */ @@ -82,11 +76,8 @@ public enum Compare implements BiPredicate { }, /** - * Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the - * same class (i.e. double for the first object and long for the second object) both values are converted to - * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated - * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare - *
[3/4] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/02e0b8b3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/02e0b8b3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/02e0b8b3 Branch: refs/heads/master Commit: 02e0b8b33c6698cefa62d03f237f5dbe0b1ab9e3 Parents: d9ccefc 21059b9 Author: Daniel Kuppitz Authored: Fri Oct 5 09:59:58 2018 -0700 Committer: Daniel Kuppitz Committed: Fri Oct 5 09:59:58 2018 -0700 -- .../gremlin/process/traversal/Compare.java | 63 ++-- .../gremlin/process/traversal/PTest.java| 10 +++- 2 files changed, 27 insertions(+), 46 deletions(-) --
tinkerpop git commit: TINKERPOP-1972 Fix arg handling for inject step
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1972 2a2e47ebd -> dee155e50 TINKERPOP-1972 Fix arg handling for inject step To be precise, this affects all steps that have a params array with a generic type parameter as the member type but currently inject is the only step in Gremlin.Net that has such an array as an argument. The arguments passed as such a params array were incorrectly wrapped in one array before instead of individual arguments. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dee155e5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dee155e5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dee155e5 Branch: refs/heads/TINKERPOP-1972 Commit: dee155e50eab747afa1d302ed0c027c8c3629e2b Parents: 2a2e47e Author: Florian Hockmann Authored: Fri Oct 5 17:32:09 2018 +0200 Committer: Florian Hockmann Committed: Fri Oct 5 17:32:09 2018 +0200 -- gremlin-dotnet/glv/GraphTraversal.template | 5 +++-- gremlin-dotnet/glv/GraphTraversalSource.template| 5 +++-- gremlin-dotnet/glv/generate.groovy | 16 +++- .../Gremlin.Net/Process/Traversal/GraphTraversal.cs | 5 +++-- .../Process/Traversal/GraphTraversalSource.cs | 5 +++-- .../BytecodeGeneration/BytecodeGenerationTests.cs | 12 6 files changed, 31 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dee155e5/gremlin-dotnet/glv/GraphTraversal.template -- diff --git a/gremlin-dotnet/glv/GraphTraversal.template b/gremlin-dotnet/glv/GraphTraversal.template index 6738467..9e4b284 100644 --- a/gremlin-dotnet/glv/GraphTraversal.template +++ b/gremlin-dotnet/glv/GraphTraversal.template @@ -22,6 +22,7 @@ #endregion using System.Collections.Generic; +using System.Linq; using Gremlin.Net.Structure; // THIS IS A GENERATED FILE - DO NOT MODIFY THIS FILE DIRECTLY - see pom.xml @@ -68,8 +69,8 @@ namespace Gremlin.Net.Process.Traversal public GraphTraversal<$method.t1, $method.t2> <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %> (<%= method.parameters %>) { <% if (method.parameters.contains("params ")) { - %>var args = new List<$method.argsListType>(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; -args.AddRange(<%= method.paramNames.last() %>); + %>var args = new List(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; +args.AddRange(<%= method.paramNames.last() %><% if (method.isArgsCastNecessary) { %>.Cast()<% } %>); Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } else { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dee155e5/gremlin-dotnet/glv/GraphTraversalSource.template -- diff --git a/gremlin-dotnet/glv/GraphTraversalSource.template b/gremlin-dotnet/glv/GraphTraversalSource.template index afa4297..bbc3684 100644 --- a/gremlin-dotnet/glv/GraphTraversalSource.template +++ b/gremlin-dotnet/glv/GraphTraversalSource.template @@ -23,6 +23,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Gremlin.Net.Process.Remote; using Gremlin.Net.Process.Traversal.Strategy.Decoration; using Gremlin.Net.Structure; @@ -131,8 +132,8 @@ namespace Gremlin.Net.Process.Traversal { var traversal = new GraphTraversal<$method.typeNameString>(TraversalStrategies, new Bytecode(Bytecode)); <% if (method.parameters.contains("params ")) { - %>var args = new List<$method.argsListType>(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; -args.AddRange(<%= method.paramNames.last() %>); + %>var args = new List(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; +args.AddRange(<%= method.paramNames.last() %><% if (method.isArgsCastNecessary) { %>.Cast()<% } %>); traversal.Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } else { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dee155e5/gremlin-dotnet/glv/generate.groovy -- diff --git a/gremlin-dotnet/glv/generate.groovy b/gremlin-dotnet/glv/generate.groovy index 29f9ec7..2d8b005 100644 --- a/gremlin-dotnet/glv/generate.groovy +++
[17/50] [abbrv] tinkerpop git commit: Optimazes Map with enum using the EnumMap implementation
Optimazes Map with enum using the EnumMap implementation Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9e1865a9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9e1865a9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9e1865a9 Branch: refs/heads/TINKERPOP-2053 Commit: 9e1865a98d9350451d29dc837e053109d714d7e3 Parents: fcbce50 Author: Otavio Santana Authored: Wed Oct 3 14:17:07 2018 -0300 Committer: Otavio Santana Committed: Wed Oct 3 14:17:07 2018 -0300 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- .../gremlin/structure/util/star/StarGraphGryoSerializer.java| 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java index 3718d16..65d74d2 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java @@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import java.io.Serializable; import java.util.Collections; +import java.util.EnumMap; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -80,7 +81,7 @@ public final class GraphFilter implements Cloneable, Serializable { private Traversal.Admin vertexFilter = null; private Traversal.Admin edgeFilter = null; -private Map> edgeLegality = new HashMap<>(); +private Map> edgeLegality = new EnumMap<>(Direction.class); private boolean allowNoEdges = false; public GraphFilter() { @@ -118,7 +119,7 @@ public final class GraphFilter implements Cloneable, Serializable { throw GraphComputer.Exceptions.edgeFilterAccessesAdjacentVertices(edgeFilter); this.edgeFilter = edgeFilter.asAdmin().clone(); -this.edgeLegality = new HashMap<>(); +this.edgeLegality = new EnumMap<>(Direction.class); this.edgeLegality.put(Direction.OUT, new HashMap<>()); this.edgeLegality.put(Direction.IN, new HashMap<>()); this.edgeLegality.put(Direction.BOTH, new HashMap<>()); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java index c32777b..cc0e6b4 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/strategy/optimization/GraphFilterStrategy.java @@ -39,7 +39,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; import java.util.Collections; -import java.util.HashMap; +import java.util.EnumMap; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -77,7 +77,7 @@ public final class GraphFilterStrategy extends AbstractTraversalStrategy> directionLabels = new HashMap<>(); +final Map> directionLabels = new EnumMap<>(Direction.class); final Set outLabels = new HashSet<>(); final Set inLabels = new HashSet<>(); final Set bothLabels = new HashSet<>(); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e1865a9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java index b2379ce..86bbf98 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java +++
[15/50] [abbrv] tinkerpop git commit: Merge branch 'tp33' of https://git-wip-us.apache.org/repos/asf/tinkerpop into tp33
Merge branch 'tp33' of https://git-wip-us.apache.org/repos/asf/tinkerpop into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1faf7629 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1faf7629 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1faf7629 Branch: refs/heads/TINKERPOP-2053 Commit: 1faf7629cb7b3882e91a8f437ad23197aba385dc Parents: 8ca2778 650f31f Author: Florian Hockmann Authored: Wed Oct 3 12:33:02 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:33:02 2018 +0200 -- .../traversal/dsl/graph/GraphTraversal.java | 48 .../step/sideEffect/SideEffectCapStep.java | 4 +- 2 files changed, 30 insertions(+), 22 deletions(-) --
[41/50] [abbrv] tinkerpop git commit: Moved tests that fail periodically to integration tests.
Moved tests that fail periodically to integration tests. These tests require Grape and external resources to pass. Those resources seem to be less dependable on Travis sometimes and causes test failures. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4bdb006c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4bdb006c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4bdb006c Branch: refs/heads/TINKERPOP-2053 Commit: 4bdb006c5ee418f27ef7bb8a9330714ce414c50f Parents: ca034f1 Author: Stephen Mallette Authored: Fri Oct 5 06:38:42 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 06:53:21 2018 -0400 -- .../jsr223/GremlinGroovyScriptEngineTest.java | 33 ++--- .../GremlinGroovyScriptEngineIntegrateTest.java | 37 2 files changed, 39 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java index 54e997f..2803c24 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java @@ -38,7 +38,8 @@ import javax.script.ScriptContext; import javax.script.ScriptEngine; import javax.script.ScriptException; import javax.script.SimpleBindings; -import java.awt.*; +import java.awt.Color; +import java.awt.SystemColor; import java.io.StringWriter; import java.util.ArrayList; import java.util.Arrays; @@ -266,36 +267,6 @@ public class GremlinGroovyScriptEngineTest { } @Test -public void shouldLoadImportsViaDependencyManagerFromDependencyGatheredByUse() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath"))); -engine.use("org.apache.commons", "commons-math3", "3.2"); -assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)")); -} - -@Test -public void shouldAllowsUseToBeExecutedAfterImport() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.use("org.apache.commons", "commons-math3", "3.2"); -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.commons.math3.util.FastMath"))); -assertEquals(1235, engine.eval("org.apache.commons.math3.util.FastMath.abs(-1235)")); -} - -@Test public void shouldAllowsMultipleImports() throws Exception { final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); try { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdb006c/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java -- diff --git a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java index 5242d3b..c595209 100644 --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/jsr223/GremlinGroovyScriptEngineIntegrateTest.java @@ -18,16 +18,23 @@ */ package org.apache.tinkerpop.gremlin.jsr223; +import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; +import
[32/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9e407898 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9e407898 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9e407898 Branch: refs/heads/TINKERPOP-2053 Commit: 9e4078983bb41a66f17cd33d599168a8ec78295b Parents: 8b69b34 650d1e8 Author: Stephen Mallette Authored: Thu Oct 4 12:12:02 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 12:12:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/docs/src/reference/gremlin-applications.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9e407898/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java --
[35/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28bf3046 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28bf3046 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28bf3046 Branch: refs/heads/TINKERPOP-2053 Commit: 28bf30468cca9bbd5c95b3814619801348cfad96 Parents: 650d1e8 80fa89b Author: Stephen Mallette Authored: Thu Oct 4 14:10:54 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:10:54 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../io/graphson/GraphSONSerializersV2d0.java| 19 ++-- .../GraphSONMapperEmbeddedTypeTest.java | 14 ++ .../IO/GraphSON/GraphSONReaderTests.cs | 49 +--- .../IO/GraphSON/GraphSONWriterTests.cs | 32 - .../lib/structure/io/type-serializers.js| 30 +++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphsonV2d0.py | 26 +++ .../tests/structure/io/test_graphsonV2d0.py | 25 ++ 10 files changed, 224 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/docs/src/dev/io/graphson.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28bf3046/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java -- diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java index a375e3b,e5f2693..c9400cd --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java @@@ -44,16 -44,8 +44,17 @@@ import java.time.ZoneOffset import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Map; +import java.util.Set; +import static org.hamcrest.CoreMatchers.any; +import static org.hamcrest.Matchers.either; ++import static org.hamcrest.core.IsNot.not; import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeThat; @@@ -85,58 -74,21 +86,71 @@@ public class GraphSONMapperEmbeddedType public String version; @Test + public void shouldHandleNumberConstants() throws Exception { -assumeThat(version, startsWith("v2")); ++assumeThat(version, not(startsWith("v1"))); + + final List o = new ArrayList<>(); + o.add(123.321d); + o.add(Double.NaN); + o.add(Double.NEGATIVE_INFINITY); + o.add(Double.POSITIVE_INFINITY); + + assertEquals(o, serializeDeserialize(mapper, o, List.class)); + } + + @Test +public void shouldHandleMap() throws Exception { +assumeThat(version, startsWith("v3")); + +final Map o = new LinkedHashMap<>(); +o.put("string key", "string value"); +o.put(1, 1); +o.put(1L, 1L); + +final List l = Arrays.asList("test", 1, 5L); +o.put(l, "crazy"); + +assertEquals(o, serializeDeserialize(mapper, o, Map.class)); +} + +@Test +public void shouldHandleList() throws Exception { +assumeThat(version, startsWith("v3")); + +final List o = new ArrayList<>(); +o.add("test"); +o.add(1); +o.add(1); +o.add(1L); +o.add(1L); + +final List l = Arrays.asList("test", 1, 5L); +o.add(l); + +assertEquals(o, serializeDeserialize(mapper, o, List.class)); +}
[39/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/86b1be53 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/86b1be53 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/86b1be53 Branch: refs/heads/TINKERPOP-2053 Commit: 86b1be53538def07deb337025467ee4b5e04dd37 Parents: 5b9b81f ca034f1 Author: Stephen Mallette Authored: Thu Oct 4 16:47:46 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 16:47:46 2018 -0400 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) --
[16/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' of https://git-wip-us.apache.org/repos/asf/tinkerpop into tp32
Merge branch 'tp32' of https://git-wip-us.apache.org/repos/asf/tinkerpop into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fcbce509 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fcbce509 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fcbce509 Branch: refs/heads/TINKERPOP-2053 Commit: fcbce509fc2957bae74ef585875dd872322a9b21 Parents: b440742 76c9aba Author: Florian Hockmann Authored: Wed Oct 3 12:33:23 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:33:23 2018 +0200 -- .../traversal/dsl/graph/GraphTraversal.java | 48 .../step/sideEffect/SideEffectCapStep.java | 4 +- 2 files changed, 30 insertions(+), 22 deletions(-) --
[43/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/73444c32 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/73444c32 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/73444c32 Branch: refs/heads/TINKERPOP-2053 Commit: 73444c321dfebf6b10e516b8f7c39c6039c5a3f6 Parents: 2d69efd d9ccefc Author: Stephen Mallette Authored: Fri Oct 5 07:02:40 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 07:02:40 2018 -0400 -- .../groovy/jsr223/GremlinGroovyScriptEngineTest.java | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) --
[23/50] [abbrv] tinkerpop git commit: TINKERPOP-2044 Configurable traversal to validate host connectivity.
TINKERPOP-2044 Configurable traversal to validate host connectivity. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b510613b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b510613b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b510613b Branch: refs/heads/TINKERPOP-2053 Commit: b510613b10962a3e8d95c3e590b5f58297227d0e Parents: 88d6f77 Author: Stephen Mallette Authored: Fri Sep 28 15:54:30 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 08:16:44 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index c4523d8..f3340cc 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -39,6 +39,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. +* Added `Cluster` configuration option to set a custom validation script to use to test server connectivity in the Java driver. * Improved ability of `GroovyTranslator` to handle more types supported by GraphSON. * Improved ability of `GroovyTranslator` to handle custom types. * Added better internal processing of `Column` in `by(Function)`. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/docs/src/reference/gremlin-applications.asciidoc -- diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index 1cd9964..5607667 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -750,6 +750,7 @@ The following table describes the various configuration options for the Gremlin |connectionPool.sslSkipCertValidation |Configures the `TrustManager` to trust all certs without any validation. Should not be used in production.|false |connectionPool.trustStore |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the default `TrustManager` will be used. |_none_ |connectionPool.trustStorePassword |The password of the `trustStore` if it is password-protected |_none_ +|connectionPool.validationRequest |A script that is used to test server connectivity. A good script to use is one that evaluates quickly and returns no data. The default simply returns an empty string, but if a graph is required by a particular provider, a good traversal might be `g.inject()`. |_''_ |hosts |The list of hosts that the driver will connect to. |localhost |jaasEntry |Sets the `AuthProperties.Property.JAAS_ENTRY` properties for authentication to Gremlin Server. |_none_ |nioPoolSize |Size of the pool for handling request/response operations. |available processors http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b510613b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java -- diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java index 9adaaa1..c090584 100644 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java @@ -25,11 +25,16 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import org.apache.commons.configuration.Configuration; +import org.apache.tinkerpop.gremlin.driver.message.RequestMessage; import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import io.netty.bootstrap.Bootstrap; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.apache.tinkerpop.gremlin.process.traversal.Bytecode; +import
[36/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Support NaN/Infinity on GraphSON 3.0
TINKERPOP-2055 Support NaN/Infinity on GraphSON 3.0 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5b9b81fd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5b9b81fd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5b9b81fd Branch: refs/heads/TINKERPOP-2053 Commit: 5b9b81fdea9778f777a01aa2a70bc93510f16399 Parents: 28bf304 Author: Stephen Mallette Authored: Thu Oct 4 14:53:04 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:53:04 2018 -0400 -- .../structure/io/graphson/GraphSONModule.java | 2 +- .../io/graphson/GraphSONSerializersV3d0.java| 23 - .../IO/GraphSON/GraphSONReaderTests.cs | 7 +++--- .../IO/GraphSON/GraphSONWriterTests.cs | 2 +- .../gremlin_python/structure/io/graphsonV3d0.py | 26 .../tests/structure/io/test_graphsonV3d0.py | 22 + 6 files changed, 71 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b9b81fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java index 2e795a5..39f1927 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java @@ -254,7 +254,7 @@ abstract class GraphSONModule extends TinkerPopJacksonModule { // numbers addDeserializer(Integer.class, new GraphSONSerializersV3d0.IntegerJackonsDeserializer()); -addDeserializer(Double.class, new GraphSONSerializersV3d0.DoubleJackonsDeserializer()); +addDeserializer(Double.class, new GraphSONSerializersV3d0.DoubleJacksonDeserializer()); // traversal addDeserializer(Bytecode.class, new TraversalSerializersV3d0.BytecodeJacksonDeserializer()); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5b9b81fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java index 8c601b1..8d80478 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV3d0.java @@ -47,11 +47,9 @@ import org.apache.tinkerpop.shaded.jackson.core.JsonProcessingException; import org.apache.tinkerpop.shaded.jackson.core.JsonToken; import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext; import org.apache.tinkerpop.shaded.jackson.databind.JavaType; -import org.apache.tinkerpop.shaded.jackson.databind.JsonNode; import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider; import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer; import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer; -import org.apache.tinkerpop.shaded.jackson.databind.node.ArrayNode; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdKeySerializer; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer; import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer; @@ -705,15 +703,28 @@ class GraphSONSerializersV3d0 { } } -static class DoubleJackonsDeserializer extends StdDeserializer { +static class DoubleJacksonDeserializer extends StdDeserializer { -protected DoubleJackonsDeserializer() { +protected DoubleJacksonDeserializer() { super(Double.class); } @Override -public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { -return jsonParser.getDoubleValue(); +public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +if (jsonParser.getCurrentToken().isNumeric()) +return jsonParser.getDoubleValue(); +else { +final String numberText = jsonParser.getValueAsString(); +if
[14/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/21d2444c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/21d2444c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/21d2444c Branch: refs/heads/TINKERPOP-2053 Commit: 21d2444c6f404d24ed47d08f03806d73244b5691 Parents: 7ac00a1 8ca2778 Author: Florian Hockmann Authored: Wed Oct 3 12:31:48 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:31:48 2018 +0200 -- CHANGELOG.asciidoc | 1 + .../src/Gremlin.Net/Driver/Connection.cs| 6 +++-- .../src/Gremlin.Net/Driver/ConnectionFactory.cs | 7 -- .../src/Gremlin.Net/Driver/GremlinClient.cs | 11 +++-- .../Gremlin.Net/Driver/WebSocketConnection.cs | 9 +-- .../Driver/GremlinClientTests.cs| 25 6 files changed, 51 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21d2444c/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21d2444c/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs -- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs index 822fc65,b79f0e6..92e0d35 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs @@@ -51,9 -52,10 +52,10 @@@ namespace Gremlin.Net.Drive _graphSONReader = graphSONReader; _graphSONWriter = graphSONWriter; _messageSerializer = new JsonMessageSerializer(mimeType); + _webSocketConnection = new WebSocketConnection(webSocketConfiguration); } -public async Task> SubmitAsync(RequestMessage requestMessage) +public async Task> SubmitAsync(RequestMessage requestMessage) { await SendAsync(requestMessage).ConfigureAwait(false); return await ReceiveAsync().ConfigureAwait(false); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21d2444c/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinClient.cs -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/21d2444c/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/GremlinClientTests.cs --
[34/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-2055' into tp32
Merge branch 'TINKERPOP-2055' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/80fa89bd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/80fa89bd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/80fa89bd Branch: refs/heads/TINKERPOP-2053 Commit: 80fa89bdff687f4dcd3c48965be7cb9478fadccc Parents: b510613 bd7048d Author: Stephen Mallette Authored: Thu Oct 4 14:03:44 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:03:44 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../io/graphson/GraphSONSerializersV2d0.java| 19 -- .../GraphSONMapperEmbeddedTypeTest.java | 15 .../IO/GraphSON/GraphSONReaderTests.cs | 38 ++- .../IO/GraphSON/GraphSONWriterTests.cs | 30 +++ .../lib/structure/io/type-serializers.js| 30 ++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphson.py | 26 + .../jython/tests/structure/io/test_graphson.py | 25 + 10 files changed, 218 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/80fa89bd/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index f3340cc,33d35d3..a7e6388 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -38,10 -37,8 +38,11 @@@ image::https://raw.githubusercontent.co * Added support for GraphSON serialization of `Date` in Javascript. * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. + * Added support for `Double.NaN`, `Double.POSITIVE_INFINITY` and `Double.NEGATIVE_INFINITY`. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. +* Added `Cluster` configuration option to set a custom validation script to use to test server connectivity in the Java driver. +* Improved ability of `GroovyTranslator` to handle more types supported by GraphSON. +* Improved ability of `GroovyTranslator` to handle custom types. * Added better internal processing of `Column` in `by(Function)`. * Added `hasNext()` support on `Traversal` for `gremlin-python`. * Added support for additional extended types in Gremlin.Net with `decimal`, `TimeSpan`, `BigInteger`, `byte`, `byte[]`, `char` and `short`.
[20/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2b4c993d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2b4c993d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2b4c993d Branch: refs/heads/TINKERPOP-2053 Commit: 2b4c993ddd16a4554858d480103952374897 Parents: 1faf762 88d6f77 Author: Stephen Mallette Authored: Wed Oct 3 16:09:06 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 16:09:06 2018 -0400 -- CHANGELOG.asciidoc | 2 + .../gremlin/jsr223/TranslatorCustomizer.java| 38 .../gremlin/process/traversal/Translator.java | 34 +++ .../jsr223/GremlinGroovyScriptEngine.java | 11 +- .../gremlin/groovy/jsr223/GroovyTranslator.java | 34 ++- .../groovy/jsr223/GroovyTranslatorTest.java | 215 +-- 6 files changed, 309 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2b4c993d/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2b4c993d/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java -- diff --cc gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java index 03ea883,b96b8b9..7785da6 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java @@@ -222,19 -236,27 +224,20 @@@ public class GremlinGroovyScriptEngine private final ImportGroovyCustomizer importGroovyCustomizer; private final List groovyCustomizers; -private final Set artifactsToUse = new HashSet<>(); private final boolean interpreterModeEnabled; private final long expectedCompilationTime; + private final Translator.ScriptTranslator.TypeTranslator typeTranslator; /** - * Creates a new instance using the {@link DefaultImportCustomizerProvider}. + * There is no need to require type checking infrastructure if type checking is not enabled. */ -public GremlinGroovyScriptEngine() { -this(new Customizer[0]); -} +private final boolean typeCheckingEnabled; /** - * @deprecated As of release 3.0.1, replaced by {@link #GremlinGroovyScriptEngine(CompilerCustomizerProvider...)} + * Creates a new instance using no {@link Customizer}. */ -@Deprecated -public GremlinGroovyScriptEngine(final ImportCustomizerProvider importCustomizerProvider) { -this((CompilerCustomizerProvider) importCustomizerProvider); +public GremlinGroovyScriptEngine() { +this(new Customizer[0]); } public GremlinGroovyScriptEngine(final Customizer... customizers) { @@@ -273,6 -289,58 +276,12 @@@ interpreterModeEnabled = groovyCustomizers.stream() .anyMatch(p -> p.getClass().equals(InterpreterModeGroovyCustomizer.class)); + final Optional translatorCustomizer = listOfCustomizers.stream(). + filter(p -> p instanceof TranslatorCustomizer). + map(p -> (TranslatorCustomizer) p).findFirst(); + typeTranslator = translatorCustomizer.isPresent() ? translatorCustomizer.get().createTypeTranslator() : + Translator.ScriptTranslator.TypeTranslator.identity(); + -// not using the old provider model so set that to empty list so that when createClassLoader is called -// it knows to use groovyCustomizers instead -customizerProviders = Collections.emptyList(); - -createClassLoader(); -} - -/** - * Creates a new instance with the specified {@link CompilerCustomizerProvider} objects. - * - * @deprecated As of release 3.2.4, replaced by {@link #GremlinGroovyScriptEngine(Customizer...)}. - */ -@Deprecated -public GremlinGroovyScriptEngine(final CompilerCustomizerProvider... compilerCustomizerProviders) { -final List providers = Arrays.asList(compilerCustomizerProviders); - -GremlinLoader.load(); - -importCustomizerProvider = providers.stream() -.filter(p -> p instanceof ImportCustomizerProvider) -.map(p -> (ImportCustomizerProvider) p) -
[22/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-2049'
Merge branch 'TINKERPOP-2049' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3a8f5808 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3a8f5808 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3a8f5808 Branch: refs/heads/TINKERPOP-2053 Commit: 3a8f580880796fb81619c3572ab2167088320026 Parents: 2ae8c5b 9b4cddb Author: Stephen Mallette Authored: Thu Oct 4 06:48:39 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 06:48:39 2018 -0400 -- CHANGELOG.asciidoc | 2 +- .../traversal/dsl/graph/GraphTraversal.java| 17 + .../traversal/dsl/graph/GraphTraversalTest.java| 15 +-- .../Process/Traversal/GraphTraversal.cs| 9 + gremlin-test/features/map/ShortestPath.feature | 4 ++-- .../traversal/step/map/ShortestPathTest.java | 4 ++-- 6 files changed, 44 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3a8f5808/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3a8f5808/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java --
[24/50] [abbrv] tinkerpop git commit: TINKERPOP-2041 Added IO tests for TextP
TINKERPOP-2041 Added IO tests for TextP Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8b69b34b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8b69b34b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8b69b34b Branch: refs/heads/TINKERPOP-2053 Commit: 8b69b34b6393a3071c0cd491ea9ec0ca09a1e5ae Parents: 9b96586 Author: Stephen Mallette Authored: Wed Oct 3 15:01:40 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/dev/io/graphson.asciidoc | 26 .../scripts/generate-graphson-resources.groovy | 12 - .../tinkerpop/gremlin/structure/io/Model.java | 9 +++ .../io/AbstractTypedCompatibilityTest.java | 14 +++ .../io/graphson/_3_4_0/textp-v2d0-partial.json | 7 ++ .../io/graphson/_3_4_0/textp-v3d0.json | 7 ++ .../structure/io/gryo/_3_4_0/textp-v1d0.kryo| 1 + .../structure/io/gryo/_3_4_0/textp-v3d0.kryo| 1 + 8 files changed, 71 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8b69b34b/docs/src/dev/io/graphson.asciidoc -- diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index d140a2f..1c9081c 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -3014,6 +3014,19 @@ The following `Bytecode` example represents the traversal of `g.V().hasLabel('pe } + TextP + +[source,json] + +{ + "@type" : "g:TextP", + "@value" : { +"predicate" : "containing", +"value" : "ark" + } +} + + TraversalMetrics [source,json] @@ -5392,6 +5405,19 @@ Please see <<_p,P>> for additional information on `within`. } + TextP + +[source,json] + +{ + "@type" : "g:TextP", + "@value" : { +"predicate" : "containing", +"value" : "ark" + } +} + + TraversalMetrics [source,json] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8b69b34b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy -- diff --git a/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy index 55b4fa6..03112ed 100644 --- a/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy +++ b/gremlin-tools/gremlin-io-test/scripts/generate-graphson-resources.groovy @@ -59,19 +59,19 @@ toJson = { o, type, mapper, comment = "", suffix = "" -> writeSupportedV1Objects = { writer, mapper -> writer.write("=== Graph Structure\n\n") -model.entries("Graph Structure").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { +model.entries("Graph Structure").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } writer.write("\n") writer.write("=== RequestMessage\n\n") - model.entries("RequestMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { + model.entries("RequestMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } writer.write("\n") writer.write("=== ResponseMessage\n\n") - model.entries("ResponseMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_3_0)}.each { + model.entries("ResponseMessage").findAll{it.isCompatibleWith(GraphSONCompatibility.V1D0_3_4_0)}.each { writer.write(toJsonV1d0NoTypes(it.getObject(), it.getTitle(), mapper, it.getDescription())) } } @@ -156,7 +156,7 @@ mapper = GraphSONMapper.build(). file = new File("${projectBuildDir}/dev-docs/out-graphson-2d0-partial.txt") if (file.exists()) file.delete() -file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0PartialTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_PARTIAL_3_3_1)}, v2ExtendedDescription) } +file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0PartialTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_PARTIAL_3_4_0)}, v2ExtendedDescription) } mapper = GraphSONMapper.build(). addRegistry(TinkerIoRegistryV2d0.instance()). @@ -167,7 +167,7 @@ mapper = GraphSONMapper.build(). file = new File("${projectBuildDir}/dev-docs/out-graphson-2d0-no-type.txt") if (file.exists()) file.delete() -file.withWriter { writeSupportedV2V3Objects(it, mapper, toJsonV2d0NoTypes, {it.isCompatibleWith(GraphSONCompatibility.V2D0_NO_TYPE_3_3_1)}, v2ExtendedDescription) }
tinkerpop git commit: TINKERPOP-1959 Minor fixes to upgrade docs
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1959 67e56dd60 -> 54a12eb1c TINKERPOP-1959 Minor fixes to upgrade docs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/54a12eb1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/54a12eb1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/54a12eb1 Branch: refs/heads/TINKERPOP-1959 Commit: 54a12eb1ca338ab304f7ca7afc6e2a57c6d23107 Parents: 67e56dd Author: Stephen Mallette Authored: Fri Oct 5 10:37:24 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:37:24 2018 -0400 -- docs/src/upgrade/release-3.2.x-incubating.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54a12eb1/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 7f1cd18..1615204 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -107,7 +107,8 @@ via that same method as the other toy graphs with `TinkerFactory.createGratefulD Gremlin Javascript Script Submission -Gremlin Javascript can now submit script, with optional bindings, using the Client class: +Gremlin Javascript can now submit script, with optional bindings, using the `Client` class: + [source,javascript] const gremlin = require('gremlin'); @@ -126,7 +127,7 @@ connection.submit('g.V(vid)', {vid: 1}) }); -and you can also translate bytecode steps into script +and also allows translation of bytecode steps into script: [source,javascript]
[13/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8ca27786 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8ca27786 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8ca27786 Branch: refs/heads/TINKERPOP-2053 Commit: 8ca277863861699ca2fa7913735687f6e65b486b Parents: c10bde3 b440742 Author: Florian Hockmann Authored: Wed Oct 3 12:31:08 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:31:08 2018 +0200 -- CHANGELOG.asciidoc | 1 + .../src/Gremlin.Net/Driver/Connection.cs| 6 +++-- .../src/Gremlin.Net/Driver/ConnectionFactory.cs | 7 -- .../src/Gremlin.Net/Driver/GremlinClient.cs | 11 +++-- .../Gremlin.Net/Driver/WebSocketConnection.cs | 9 +-- .../Driver/GremlinClientTests.cs| 25 6 files changed, 51 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs -- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs index 279c708,f63e20b..b79f0e6 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs @@@ -36,21 -37,21 +37,22 @@@ namespace Gremlin.Net.Drive { private readonly GraphSONReader _graphSONReader; private readonly GraphSONWriter _graphSONWriter; -private readonly JsonMessageSerializer _messageSerializer = new JsonMessageSerializer(); +private readonly JsonMessageSerializer _messageSerializer; private readonly Uri _uri; - private readonly WebSocketConnection _webSocketConnection = new WebSocketConnection(); + private readonly WebSocketConnection _webSocketConnection; private readonly string _username; private readonly string _password; public Connection(Uri uri, string username, string password, GraphSONReader graphSONReader, - GraphSONWriter graphSONWriter, string mimeType) -GraphSONWriter graphSONWriter, Action webSocketConfiguration) ++GraphSONWriter graphSONWriter, string mimeType, Action webSocketConfiguration) { _uri = uri; _username = username; _password = password; _graphSONReader = graphSONReader; _graphSONWriter = graphSONWriter; +_messageSerializer = new JsonMessageSerializer(mimeType); + _webSocketConnection = new WebSocketConnection(webSocketConfiguration); } public async Task> SubmitAsync(RequestMessage requestMessage) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ca27786/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs -- diff --cc gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs index e2ff5b7,8b14ed9..7a6c2d5 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs @@@ -30,22 -31,22 +31,24 @@@ namespace Gremlin.Net.Drive { private readonly GraphSONReader _graphSONReader; private readonly GraphSONWriter _graphSONWriter; + private readonly Action _webSocketConfiguration; private readonly GremlinServer _gremlinServer; +private readonly string _mimeType; public ConnectionFactory(GremlinServer gremlinServer, GraphSONReader graphSONReader, - GraphSONWriter graphSONWriter, string mimeType) -GraphSONWriter graphSONWriter, Action webSocketConfiguration) ++GraphSONWriter graphSONWriter, string mimeType, Action webSocketConfiguration) { _gremlinServer = gremlinServer; -_graphSONReader = graphSONReader; -_graphSONWriter = graphSONWriter; +_mimeType = mimeType; +_graphSONReader = graphSONReader ?? throw new ArgumentNullException(nameof(graphSONReader)); +_graphSONWriter = graphSONWriter ?? throw new ArgumentNullException(nameof(graphSONWriter)); + _webSocketConfiguration = webSocketConfiguration; } public Connection CreateConnection() { return new Connection(_gremlinServer.Uri, _gremlinServer.Username, _gremlinServer.Password, _graphSONReader, - _graphSONWriter, _mimeType); -
[26/50] [abbrv] tinkerpop git commit: TINKERPOP-2041 Implemented text predicates
TINKERPOP-2041 Implemented text predicates Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/519ca65c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/519ca65c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/519ca65c Branch: refs/heads/TINKERPOP-2053 Commit: 519ca65c0aef496a1fc1c4d2166622c41ff9c1e4 Parents: 3a8f580 Author: Daniel Kuppitz Authored: Wed Sep 26 15:44:35 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- CHANGELOG.asciidoc | 1 + docs/src/reference/the-traversal.asciidoc | 34 +++-- docs/src/upgrade/release-3.4.x.asciidoc | 15 +++ .../tinkerpop/gremlin/jsr223/CoreImports.java | 3 + .../tinkerpop/gremlin/process/traversal/TP.java | 107 .../gremlin/process/traversal/Text.java | 123 +++ .../structure/io/graphson/GraphSONModule.java | 5 + .../io/graphson/TraversalSerializersV2d0.java | 35 ++ .../io/graphson/TraversalSerializersV3d0.java | 35 ++ .../structure/io/gryo/GryoSerializersV1d0.java | 21 .../structure/io/gryo/GryoSerializersV3d0.java | 21 .../gremlin/structure/io/gryo/GryoVersion.java | 7 +- .../gremlin/process/traversal/PTest.java| 15 +++ .../GraphSONMapperPartialEmbeddedTypeTest.java | 14 ++- gremlin-dotnet/glv/TP.template | 71 +++ gremlin-dotnet/glv/generate.groovy | 14 ++- .../src/Gremlin.Net/Process/Traversal/TP.cs | 96 +++ .../Structure/IO/GraphSON/GraphSONWriter.cs | 3 +- .../Structure/IO/GraphSON/TPSerializer.cs | 45 +++ .../gremlin/groovy/jsr223/GroovyTranslator.java | 7 ++ gremlin-javascript/glv/TraversalSource.template | 45 ++- gremlin-javascript/glv/generate.groovy | 7 ++ .../main/javascript/gremlin-javascript/index.js | 1 + .../gremlin-javascript/lib/process/traversal.js | 70 ++- .../lib/structure/io/type-serializers.js| 24 +++- .../test/cucumber/feature-steps.js | 1 + gremlin-python/glv/TraversalSource.template | 21 +++- gremlin-python/glv/generate.groovy | 9 +- .../gremlin/python/jsr223/PythonTranslator.java | 7 ++ .../jython/gremlin_python/process/traversal.py | 61 - .../gremlin_python/structure/io/graphsonV2d0.py | 13 +- .../gremlin_python/structure/io/graphsonV3d0.py | 13 +- .../src/main/jython/radish/feature_steps.py | 3 +- gremlin-test/features/filter/Has.feature| 57 - .../process/traversal/step/filter/HasTest.java | 86 + 35 files changed, 1061 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/519ca65c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b475c86..554ec2f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. * Removed support for `-i` option in Gremlin Server which was previously deprecated. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/519ca65c/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 6146f9b..da7260c 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3356,24 +3356,32 @@ interface. Steps that allow for this type of modulation will explicitly state so [[a-note-on-predicates]] == A Note on Predicates -A `P` is a predicate of the form `Function`. That is, given some object, return true or false. The -provided predicates are outlined in the table below and are used in various steps such as <>-step, +A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TP` +text predicates extends the `P` predicates, but are specialized in that they are of the form `Function`. +The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. [width="100%",cols="3,15",options="header"]
[30/50] [abbrv] tinkerpop git commit: renamed text predicates and added some javadoc comments
renamed text predicates and added some javadoc comments Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9b965861 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9b965861 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9b965861 Branch: refs/heads/TINKERPOP-2053 Commit: 9b965861ed9504beaebe07f99f0ce427f702 Parents: f057fb3 Author: Daniel Kuppitz Authored: Tue Oct 2 13:11:23 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 12 +-- docs/src/upgrade/release-3.4.x.asciidoc | 4 +- .../gremlin/process/traversal/Text.java | 78 ++-- .../gremlin/process/traversal/TextP.java| 28 +++ .../gremlin/process/traversal/PTest.java| 28 +++ .../GraphSONMapperPartialEmbeddedTypeTest.java | 10 +-- .../src/Gremlin.Net/Process/Traversal/TextP.cs | 24 +++--- .../TraversalEvaluation/TextPParameter.cs | 2 +- gremlin-javascript/glv/TraversalSource.template | 4 +- .../gremlin-javascript/lib/process/traversal.js | 26 +++ .../jython/gremlin_python/process/traversal.py | 60 +++ gremlin-test/features/filter/Has.feature| 20 ++--- .../process/traversal/step/filter/HasTest.java | 50 ++--- 13 files changed, 191 insertions(+), 155 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index fdd261a..85dc1c0 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3376,12 +3376,12 @@ The provided predicates are outlined in the table below and are used in various | `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? | `P.within(objects...)` | Is the incoming object in the array of provided objects? | `P.without(objects...)` | Is the incoming object not in the array of the provided objects? -| `TextP.startsWith(string)` | Does the incoming `String` start with the provided `String`? -| `TextP.endsWith(string)` | Does the incoming `String` end with the provided `String`? -| `TextP.contains(string)` | Does the incoming `String` contain the provided `String`? -| `TextP.startsNotWith(string)` | TODO: find a better name -| `TextP.endsNotWith(string)` | TODO: find a better name -| `TextP.absent(string)` | TODO: find a better name +| `TextP.startingWith(string)` | Does the incoming `String` start with the provided `String`? +| `TextP.endingWith(string)` | Does the incoming `String` end with the provided `String`? +| `TextP.containing(string)` | Does the incoming `String` contain the provided `String`? +| `TextP.notStartingWith(string)` | Does the incoming `String` not start with the provided `String`? +| `TextP.notEndingWith(string)` | Does the incoming `String` not end with the provided `String`? +| `TextP.notContaining(string)` | Does the incoming `String` not contain the provided `String`? |= [gremlin-groovy] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 213577a..21e1899 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -35,10 +35,10 @@ Gremlin now supports simple text predicates on top of the existing `P` predicate [source,groovy] -gremlin> g.V().has("person","name", contains("o")).valueMap() +gremlin> g.V().has("person","name", containing("o")).valueMap() ==>[name:[marko],age:[29]] ==>[name:[josh],age:[32]] -gremlin> g.V().has("person","name", contains("o").and(gte("j").and(endsWith("ko".valueMap() +gremlin> g.V().has("person","name", containing("o").and(gte("j").and(endingWith("ko".valueMap() ==>[name:[marko],age:[29]] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9b965861/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java index 5169309..9c25825 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Text.java +++
[33/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Minor comment fixes
TINKERPOP-2055 Minor comment fixes Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bd7048dd Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bd7048dd Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bd7048dd Branch: refs/heads/TINKERPOP-2053 Commit: bd7048dda3e9fb20b717412ee708cffc62f2ca41 Parents: a083fbf Author: Stephen Mallette Authored: Thu Oct 4 14:02:08 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:02:19 2018 -0400 -- .../javascript/gremlin-javascript/test/unit/graphson-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd7048dd/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js index a1ac0d6..66a36c6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js @@ -46,7 +46,7 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); - it('should parse GraphSON Nan from GraphSON', function () { + it('should parse GraphSON NaN from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double", @@ -54,7 +54,7 @@ describe('GraphSONReader', function () { }); assert.ok(isNaN(result)); }); - it('should parse GraphSON -Infinity and Nan from GraphSON', function () { + it('should parse GraphSON -Infinity from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double", @@ -62,7 +62,7 @@ describe('GraphSONReader', function () { }); assert.strictEqual(result, Number.NEGATIVE_INFINITY); }); - it('should parse GraphSON Infinity and Nan from GraphSON', function () { + it('should parse GraphSON Infinity from GraphSON', function () { const reader = new GraphSONReader(); var result = reader.read({ "@type": "g:Double",
[38/50] [abbrv] tinkerpop git commit: Merge branch 'pr-948' into tp32
Merge branch 'pr-948' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ca034f12 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ca034f12 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ca034f12 Branch: refs/heads/TINKERPOP-2053 Commit: ca034f12aa2103e2b718ce52859cb51b52c3728a Parents: 80fa89b 48d5d1d Author: Stephen Mallette Authored: Thu Oct 4 16:47:33 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 16:47:33 2018 -0400 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) --
[50/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Added OptionsStrategy support for .NET
TINKERPOP-2053 Added OptionsStrategy support for .NET Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f134c8a8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f134c8a8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f134c8a8 Branch: refs/heads/TINKERPOP-2053 Commit: f134c8a8fdae5a9fff009dd4a3100d36da3e86a7 Parents: a21cde1 Author: Stephen Mallette Authored: Tue Oct 2 12:42:49 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- .../Strategy/Decoration/OptionsStrategy.cs | 53 .../GraphTraversalTests.cs | 21 2 files changed, 74 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f134c8a8/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs new file mode 100644 index 000..a5d70b0 --- /dev/null +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs @@ -0,0 +1,53 @@ +#region License + +/* + * 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. + */ + +#endregion + +using System.Collections.Generic; + +namespace Gremlin.Net.Process.Traversal.Strategy.Decoration +{ +/// +/// OptionsStrategy makes no changes to the traversal itself - it just carries configuration information +/// at the traversal level. +/// +public class OptionsStrategy : AbstractTraversalStrategy +{ +/// +/// Initializes a new instance of the class. +/// +public OptionsStrategy() +{ +} + +/// +/// Initializes a new instance of the class. +/// +/// Specifies the options for the traversal. +public OptionsStrategy(IDictionary options) +{ +foreach(var item in options) +{ +Configuration[item.Key] = item.Value; +} +} +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f134c8a8/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs index 27ac0f5..e46fa22 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs @@ -27,6 +27,7 @@ using System.Threading.Tasks; using Gremlin.Net.Process.Traversal; using Gremlin.Net.Structure; using Xunit; +using Gremlin.Net.Process.Traversal.Strategy.Decoration; namespace Gremlin.Net.IntegrationTest.Process.Traversal.DriverRemoteConnection { @@ -181,6 +182,26 @@ namespace Gremlin.Net.IntegrationTest.Process.Traversal.DriverRemoteConnection var count = g.V().Has(b.Of("propertyKey", "name"), b.Of("propertyValue", "marko")).OutE().Count().Next(); Assert.Equal(3, count); +} + +[Fact] +public void ShouldUseOptionsInTraversal() +{ +// smoke test to validate serialization of OptionsStrategy. no way to really validate this from an integration +// test perspective because there's no way to access the internals of the strategy via bytecode +var graph = new Graph(); +var connection = _connectionFactory.CreateRemoteConnection(); +var options = new Dictionary +{ +
[12/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7ac00a13 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7ac00a13 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7ac00a13 Branch: refs/heads/TINKERPOP-2053 Commit: 7ac00a13b4bfce60bc62e5c8d952681027ffebed Parents: b788201 650f31f Author: Stephen Mallette Authored: Wed Oct 3 06:13:04 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 06:13:04 2018 -0400 -- .../traversal/dsl/graph/GraphTraversal.java | 48 .../step/sideEffect/SideEffectCapStep.java | 4 +- 2 files changed, 30 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7ac00a13/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java --
[40/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d69efd5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d69efd5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d69efd5 Branch: refs/heads/TINKERPOP-2053 Commit: 2d69efd50373835a2962c48b42f6b81935d24152 Parents: e330ad6 86b1be5 Author: Stephen Mallette Authored: Thu Oct 4 16:47:56 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 16:47:56 2018 -0400 -- .../apache/tinkerpop/gremlin/process/computer/GraphFilter.java | 5 +++-- .../traversal/strategy/optimization/GraphFilterStrategy.java| 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) --
[31/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/650d1e84 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/650d1e84 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/650d1e84 Branch: refs/heads/TINKERPOP-2053 Commit: 650d1e84d0b7d6f8a213a67df593c43134e156fe Parents: 2b4c993 b510613 Author: Stephen Mallette Authored: Thu Oct 4 12:11:28 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 12:11:28 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 -- .../server/GremlinDriverIntegrateTest.java | 27 +- 7 files changed, 74 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/docs/src/reference/gremlin-applications.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java -- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java index cee1309,c090584..fe1d896 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java @@@ -880,6 -900,28 +891,17 @@@ public final class Cluster } /** + * Specify a valid Gremlin script that can be used to test remote operations. This script should be designed + * to return quickly with the least amount of overhead possible. By default, the script sends an empty string. + * If the graph does not support that sort of script because it requires all scripts to include a reference + * to a graph then a good option might be {@code g.inject()}. + */ + public Builder validationRequest(final String script) { + validationRequest = script; + return this; + } + + /** - * Time in milliseconds to wait before attempting to reconnect to a dead host after it has been marked dead. - * - * @deprecated As of release 3.2.3, the value of the initial delay is now the same as the {@link #reconnectInterval}. - */ -@Deprecated -public Builder reconnectIntialDelay(final int initialDelay) { -this.reconnectInitialDelay = initialDelay; -return this; -} - -/** * Time in milliseconds to wait between retries when attempting to reconnect to a dead host. */ public Builder reconnectInterval(final int interval) { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java -- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java index 37cecb4,c2ae045..61edd86 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java @@@ -409,6 -420,27 +411,11 @@@ final class Settings * {@link org.apache.tinkerpop.gremlin.driver.Channelizer.WebSocketChannelizer}. */ public String channelizer = Channelizer.WebSocketChannelizer.class.getName(); + + /** + * A valid Gremlin script that can be used to test remote operations. + */ + public String validationRequest = "''"; - -/** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ -@Deprecated -public String sessionId = null; - -/** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ -@Deprecated -public Optional
[46/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Added OptionsStrategy
TINKERPOP-2053 Added OptionsStrategy Included a test in TinkerGraph rather than the main test suite because the test really isn't easily asserted without a custom step that reads the OptionsStrategy. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8d0a7fa8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8d0a7fa8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8d0a7fa8 Branch: refs/heads/TINKERPOP-2053 Commit: 8d0a7fa8e2842897b63d24002ef370ef3cc58cf7 Parents: 813ab73 Author: Stephen Mallette Authored: Mon Oct 1 16:02:46 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../strategy/decoration/OptionsStrategy.java| 97 .../strategy/decoration/SubgraphStrategy.java | 1 - .../structure/io/graphson/GraphSONModule.java | 5 + .../decoration/OptionsStrategyTest.java | 38 .../decoration/OptionsStrategyTest.java | 55 +++ 6 files changed, 196 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8d0a7fa8/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 14d79aa..7d060e4 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Added `OptionsStrategy` to allow traversals to take arbitrary traversal-wide configurations. * Added text predicates. * Rewrote `ConnectiveStrategy` to support an arbitrary number of infix notations in a single traversal. * GraphSON `MessageSerializer`s will automatically register the GremlinServerModule to a provided GraphSONMapper. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8d0a7fa8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/OptionsStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/OptionsStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/OptionsStrategy.java new file mode 100644 index 000..c66fa01 --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/OptionsStrategy.java @@ -0,0 +1,97 @@ +/* + * 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.strategy.decoration; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.MapConfiguration; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * This strategy will not alter the traversal. It is only a holder for configuration options associated with the + * traversal meant to be accessed by steps or other classes that might have some interaction with it. It is + * essentially a way for users to provide traversal level configuration options that can be used in various ways by + * different graph providers. + * + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class OptionsStrategy extends AbstractTraversalStrategy implements TraversalStrategy.DecorationStrategy { +private final Map options; + +private OptionsStrategy(final Builder builder) { +options = builder.options; +} + +/** + * Gets the options on the strategy as an immutable {@code Map}. + */ +public Map getOptions() { +return Collections.unmodifiableMap(options); +} + +@Override +
[21/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2ae8c5be Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2ae8c5be Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2ae8c5be Branch: refs/heads/TINKERPOP-2053 Commit: 2ae8c5becc4318e45d6a48d32ea5e8f3eed451e5 Parents: 21d2444 2b4c993 Author: Stephen Mallette Authored: Wed Oct 3 16:09:48 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 16:09:48 2018 -0400 -- CHANGELOG.asciidoc | 2 + .../gremlin/jsr223/TranslatorCustomizer.java| 38 .../gremlin/process/traversal/Translator.java | 34 +++ .../jsr223/GremlinGroovyScriptEngine.java | 11 +- .../gremlin/groovy/jsr223/GroovyTranslator.java | 34 ++- .../groovy/jsr223/GroovyTranslatorTest.java | 215 +-- 6 files changed, 309 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2ae8c5be/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2ae8c5be/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java --
[18/50] [abbrv] tinkerpop git commit: reverts class StarGraphGryoSerializer
reverts class StarGraphGryoSerializer Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/48d5d1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/48d5d1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/48d5d1d4 Branch: refs/heads/TINKERPOP-2053 Commit: 48d5d1d4d33cd1d95354062764858e1a1b4e5d38 Parents: 9e1865a Author: Otavio Santana Authored: Wed Oct 3 15:11:00 2018 -0300 Committer: Otavio Santana Committed: Wed Oct 3 15:11:00 2018 -0300 -- .../gremlin/structure/util/star/StarGraphGryoSerializer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/48d5d1d4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java index 86bbf98..b2379ce 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphGryoSerializer.java @@ -18,7 +18,6 @@ */ package org.apache.tinkerpop.gremlin.structure.util.star; -import java.util.EnumMap; import java.util.HashMap; import java.util.Map; @@ -35,7 +34,7 @@ import org.apache.tinkerpop.gremlin.structure.io.gryo.kryoshim.shaded.ShadedSeri */ public final class StarGraphGryoSerializer extends ShadedSerializerAdapter { -private static final Map CACHE = new EnumMap<>(Direction.class); +private static final Map CACHE = new HashMap<>(); static { CACHE.put(Direction.BOTH, new StarGraphGryoSerializer(Direction.BOTH));
[09/50] [abbrv] tinkerpop git commit: Expose WebSocket configuration TINKERPOP-2015
Expose WebSocket configuration TINKERPOP-2015 Users can now provide a delegate to the Gremlin.Net driver that will be used to configure WebSocket connections. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b4407423 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b4407423 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b4407423 Branch: refs/heads/TINKERPOP-2053 Commit: b440742393135fdd88d4af18b09ade5f5011133e Parents: e7af98b Author: Florian Hockmann Authored: Sun Sep 9 14:49:03 2018 +0200 Committer: Florian Hockmann Committed: Wed Oct 3 12:08:14 2018 +0200 -- CHANGELOG.asciidoc | 1 + .../src/Gremlin.Net/Driver/Connection.cs| 6 +++-- .../src/Gremlin.Net/Driver/ConnectionFactory.cs | 8 +-- .../src/Gremlin.Net/Driver/GremlinClient.cs | 9 +-- .../Gremlin.Net/Driver/WebSocketConnection.cs | 9 +-- .../Driver/GremlinClientTests.cs| 25 6 files changed, 50 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4407423/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e93c1c9..36a34f2 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Removed conflicting non-indy groovy core dependency * Bumped jython-standalone 2.7.1 +* Added a delegate to the Gremlin.Net driver that can be used to configure the WebSocket connection. * SSL security enhancements * Added Gremlin version to Gremlin Server startup logging output. * Fixed problem with Gremlin Server sometimes returning an additional message after a failure. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4407423/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs index dbbd375..f63e20b 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Connection.cs @@ -23,6 +23,7 @@ using System; using System.Collections.Generic; +using System.Net.WebSockets; using System.Text; using System.Threading.Tasks; using Gremlin.Net.Driver.Messages; @@ -38,18 +39,19 @@ namespace Gremlin.Net.Driver private readonly GraphSONWriter _graphSONWriter; private readonly JsonMessageSerializer _messageSerializer = new JsonMessageSerializer(); private readonly Uri _uri; -private readonly WebSocketConnection _webSocketConnection = new WebSocketConnection(); +private readonly WebSocketConnection _webSocketConnection; private readonly string _username; private readonly string _password; public Connection(Uri uri, string username, string password, GraphSONReader graphSONReader, -GraphSONWriter graphSONWriter) +GraphSONWriter graphSONWriter, Action webSocketConfiguration) { _uri = uri; _username = username; _password = password; _graphSONReader = graphSONReader; _graphSONWriter = graphSONWriter; +_webSocketConnection = new WebSocketConnection(webSocketConfiguration); } public async Task> SubmitAsync(RequestMessage requestMessage) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b4407423/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs index 0041a67..8b14ed9 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionFactory.cs @@ -21,6 +21,8 @@ #endregion +using System; +using System.Net.WebSockets; using Gremlin.Net.Structure.IO.GraphSON; namespace Gremlin.Net.Driver @@ -29,20 +31,22 @@ namespace Gremlin.Net.Driver { private readonly GraphSONReader _graphSONReader; private readonly GraphSONWriter _graphSONWriter; +private readonly Action _webSocketConfiguration; private readonly GremlinServer _gremlinServer; public ConnectionFactory(GremlinServer gremlinServer, GraphSONReader graphSONReader, -GraphSONWriter graphSONWriter) +GraphSONWriter graphSONWriter, Action webSocketConfiguration) { _gremlinServer = gremlinServer; _graphSONReader = graphSONReader;
[49/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Python support for OptionsStrategy
TINKERPOP-2053 Python support for OptionsStrategy Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a21cde1a Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a21cde1a Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a21cde1a Branch: refs/heads/TINKERPOP-2053 Commit: a21cde1a667cca231c941cf943def3d5185cb99c Parents: 8d0a7fa Author: Stephen Mallette Authored: Tue Oct 2 11:44:22 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- .../main/jython/gremlin_python/process/strategies.py| 5 + .../src/main/jython/tests/driver/test_client.py | 11 +++ .../src/main/jython/tests/process/test_strategies.py| 12 +++- 3 files changed, 27 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a21cde1a/gremlin-python/src/main/jython/gremlin_python/process/strategies.py -- diff --git a/gremlin-python/src/main/jython/gremlin_python/process/strategies.py b/gremlin-python/src/main/jython/gremlin_python/process/strategies.py index f5ba9fb..9da8900 100644 --- a/gremlin-python/src/main/jython/gremlin_python/process/strategies.py +++ b/gremlin-python/src/main/jython/gremlin_python/process/strategies.py @@ -45,6 +45,11 @@ class HaltedTraverserStrategy(TraversalStrategy): self.configuration["haltedTraverserFactory"] = halted_traverser_factory +class OptionsStrategy(TraversalStrategy): +def __init__(self, options=None): +TraversalStrategy.__init__(self, configuration=options) + + class PartitionStrategy(TraversalStrategy): def __init__(self, partition_key=None, write_partition=None, read_partitions=None, include_meta_properties=None): TraversalStrategy.__init__(self) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a21cde1a/gremlin-python/src/main/jython/tests/driver/test_client.py -- diff --git a/gremlin-python/src/main/jython/tests/driver/test_client.py b/gremlin-python/src/main/jython/tests/driver/test_client.py index 42e2c07..edc5bea 100644 --- a/gremlin-python/src/main/jython/tests/driver/test_client.py +++ b/gremlin-python/src/main/jython/tests/driver/test_client.py @@ -21,6 +21,7 @@ import pytest from gremlin_python.driver.client import Client from gremlin_python.driver.protocol import GremlinServerError from gremlin_python.driver.request import RequestMessage +from gremlin_python.process.strategies import OptionsStrategy from gremlin_python.process.graph_traversal import __ from gremlin_python.structure.graph import Graph @@ -70,6 +71,16 @@ def test_client_bytecode(client): assert len(result_set.all().result()) == 6 +def test_client_bytecode_options(client): +# smoke test to validate serialization of OptionsStrategy. no way to really validate this from an integration +# test perspective because there's no way to access the internals of the strategy via bytecode +g = Graph().traversal() +t = g.withStrategies(OptionsStrategy(options={"x": "test", "y": True})).V() +message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) +result_set = client.submit(message) +assert len(result_set.all().result()) == 6 + + def test_iterate_result_set(client): g = Graph().traversal() t = g.V() http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a21cde1a/gremlin-python/src/main/jython/tests/process/test_strategies.py -- diff --git a/gremlin-python/src/main/jython/tests/process/test_strategies.py b/gremlin-python/src/main/jython/tests/process/test_strategies.py index 008ec80..9025a96 100644 --- a/gremlin-python/src/main/jython/tests/process/test_strategies.py +++ b/gremlin-python/src/main/jython/tests/process/test_strategies.py @@ -90,7 +90,7 @@ class TestTraversalStrategies(object): bytecode.source_instructions[0][1]) # even though different confs, same strategy assert 0 == len(g.traversal_strategies.traversal_strategies) # these strategies are proxies ### -bytecode = g.withStrategies(SubgraphStrategy(vertices=__.has("name","marko"))).bytecode +bytecode = g.withStrategies(SubgraphStrategy(vertices=__.has("name", "marko"))).bytecode assert 1 == len(bytecode.source_instructions) assert 2 == len(bytecode.source_instructions[0]) assert "withStrategies" == bytecode.source_instructions[0][0] @@ -98,3 +98,13 @@ class TestTraversalStrategies(object): strategy = bytecode.source_instructions[0][1] assert 1 == len(strategy.configuration) assert
[28/50] [abbrv] tinkerpop git commit: Renamed `TP` to `TextP` as proposed by @robertdale
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py -- diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py index 266e23d..2d32d47 100644 --- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py +++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py @@ -27,7 +27,7 @@ from aenum import Enum from gremlin_python import statics from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType, DictType, ListType, SetType -from gremlin_python.process.traversal import Binding, Bytecode, P, TP, Traversal, Traverser, TraversalStrategy, T +from gremlin_python.process.traversal import Binding, Bytecode, P, TextP, Traversal, Traverser, TraversalStrategy, T from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path # When we fall back to a superclass's serializer, we iterate over this map. @@ -284,15 +284,15 @@ class PSerializer(_GraphSONTypeIO): return GraphSONUtil.typedValue("P", out) -class TPSerializer(_GraphSONTypeIO): -python_type = TP +class TextPSerializer(_GraphSONTypeIO): +python_type = TextP @classmethod def dictify(cls, p, writer): out = {"predicate": p.operator, "value": [writer.toDict(p.value), writer.toDict(p.other)] if p.other is not None else writer.toDict(p.value)} -return GraphSONUtil.typedValue("TP", out) +return GraphSONUtil.typedValue("TextP", out) class BindingSerializer(_GraphSONTypeIO): http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-python/src/main/jython/radish/feature_steps.py -- diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py index 151d6d5..4777ef3 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -21,7 +21,7 @@ import json import re from gremlin_python.structure.graph import Graph, Path from gremlin_python.process.graph_traversal import __ -from gremlin_python.process.traversal import Barrier, Cardinality, P, TP, Pop, Scope, Column, Order, Direction, T, Pick, Operator, IO +from gremlin_python.process.traversal import Barrier, Cardinality, P, TextP, Pop, Scope, Column, Order, Direction, T, Pick, Operator, IO from radish import given, when, then from hamcrest import * @@ -256,7 +256,7 @@ def _make_traversal(g, traversal_string, params): "Direction": Direction, "Order": Order, "P": P, - "TP": TP, + "TextP": TextP, "IO": IO, "Pick": Pick, "Pop": Pop, http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/gremlin-test/features/filter/Has.feature -- diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature index 9d2bf4f..e272c05 100644 --- a/gremlin-test/features/filter/Has.feature +++ b/gremlin-test/features/filter/Has.feature @@ -563,7 +563,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.contains("ark")) + g.V().has("name", TextP.contains("ark")) """ When iterated to list Then the result should be unordered @@ -574,7 +574,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.startsWith("mar")) + g.V().has("name", TextP.startsWith("mar")) """ When iterated to list Then the result should be unordered @@ -585,7 +585,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", TP.endsWith("as")) + g.V().has("name", TextP.endsWith("as")) """ When iterated to list Then the result should be unordered @@ -596,7 +596,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("person", "name", TP.contains("o").and(P.lt("m"))) + g.V().has("person", "name", TextP.contains("o").and(P.lt("m"))) """ When iterated to list Then the result should be unordered @@ -607,7 +607,7 @@ Feature: Step - has() Given the modern graph And the traversal of """ - g.V().has("name", P.gt("m").and(TP.contains("o"))) + g.V().has("name", P.gt("m").and(TextP.contains("o"))) """ When iterated to list Then the result should be unordered
[42/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d9ccefce Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d9ccefce Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d9ccefce Branch: refs/heads/TINKERPOP-2053 Commit: d9ccefcea9274f00e7339b840624286e198d7832 Parents: 86b1be5 4bdb006 Author: Stephen Mallette Authored: Fri Oct 5 06:57:09 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 06:57:09 2018 -0400 -- .../groovy/jsr223/GremlinGroovyScriptEngineTest.java | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9ccefce/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java -- diff --cc gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java index 3e1d153,2803c24..83ac13d --- a/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java +++ b/gremlin-groovy/src/test/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngineTest.java @@@ -22,13 -22,16 +22,9 @@@ import groovy.lang.Closure import groovy.lang.MissingPropertyException; import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.tinkerpop.gremlin.groovy.CompilerCustomizerProvider; -import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.InterpreterModeCustomizerProvider; --import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.util.function.Lambda; --import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import org.javatuples.Pair; import org.junit.Test; --import org.slf4j.Logger; --import org.slf4j.LoggerFactory; import javax.script.Bindings; import javax.script.ScriptContext; @@@ -61,8 -73,8 +57,6 @@@ import static org.junit.Assert.fail * @author Stephen Mallette (http://stephen.genoprime.com) */ public class GremlinGroovyScriptEngineTest { --private static final Logger logger = LoggerFactory.getLogger(GremlinGroovyScriptEngineTest.class); -- private static final Object[] EMPTY_ARGS = new Object[0]; @Test @@@ -162,8 -220,78 +156,7 @@@ engine.eval("assert 1==0"); } - @Test -public void shouldLoadImportsViaDependencyManagerInterface() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("Vertex.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import org.apache.tinkerpop.gremlin.structure.Vertex"))); -assertEquals(Vertex.class.getName(), engine.eval("Vertex.class.getName()")); -} - -@Test -public void shouldLoadImportsViaDependencyManagerInterfaceAdditively() throws Exception { -final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine((CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE); -try { -engine.eval("Vertex.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -try { -engine.eval("StreamFactory.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import " + Vertex.class.getCanonicalName(; -assertEquals(Vertex.class.getName(), engine.eval("Vertex.class.getName()")); - -try { -engine.eval("IteratorUtils.class.getName()"); -fail("Should have thrown an exception because no imports were supplied"); -} catch (Exception se) { -assertTrue(se instanceof ScriptException); -} - -engine.addImports(new HashSet<>(Arrays.asList("import " + IteratorUtils.class.getCanonicalName(; -
[07/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Added tests for .Net on special numbers
TINKERPOP-2055 Added tests for .Net on special numbers Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b5420278 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b5420278 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b5420278 Branch: refs/heads/TINKERPOP-2053 Commit: b542027825fe905c0c46b81a00fe7dfd5275e8c6 Parents: 2d3041f Author: Stephen Mallette Authored: Wed Oct 3 05:11:56 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 05:11:56 2018 -0400 -- .../IO/GraphSON/GraphSONReaderTests.cs | 38 ++-- .../IO/GraphSON/GraphSONWriterTests.cs | 30 2 files changed, 66 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5420278/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs index 74bf385..08a91ae 100644 --- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs @@ -24,11 +24,9 @@ using System; using System.Collections.Generic; using System.Numerics; -using Gremlin.Net.Process.Traversal; using Gremlin.Net.Structure; using Gremlin.Net.Structure.IO.GraphSON; using Moq; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Xunit; @@ -178,6 +176,42 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON } [Fact] +public void ShouldDeserializeNaN() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'NaN'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.NaN, deserializedValue); +} + +[Fact] +public void ShouldDeserializePositiveInfinity() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'Infinity'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.PositiveInfinity, deserializedValue); +} + +[Fact] +public void ShouldDeserializeNegativeInfinity() +{ +var serializedValue = "{\"@type\":\"g:Double\",\"@value\":'-Infinity'}"; +var reader = CreateStandardGraphSONReader(); + +var jObject = JObject.Parse(serializedValue); +var deserializedValue = reader.ToObject(jObject); + +Assert.Equal(Double.NegativeInfinity, deserializedValue); +} + +[Fact] public void ShouldDeserializeDecimal() { var serializedValue = "{\"@type\":\"gx:BigDecimal\",\"@value\":-8.201}"; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b5420278/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs index a544fb3..13fbddc 100644 --- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs @@ -81,6 +81,36 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON } [Fact] +public void ShouldSerializeNaN() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.NaN); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"NaN\"}", graphSon); +} + +[Fact] +public void ShouldSerializePositiveInfinity() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.PositiveInfinity); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"Infinity\"}", graphSon); +} + +[Fact] +public void ShouldSerializeNegativeInfinity() +{ +var writer = CreateStandardGraphSONWriter(); + +var graphSon = writer.WriteObject(Double.NegativeInfinity); + +Assert.Equal("{\"@type\":\"g:Double\",\"@value\":\"-Infinity\"}", graphSon); +} + +
[11/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/650f31f1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/650f31f1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/650f31f1 Branch: refs/heads/TINKERPOP-2053 Commit: 650f31f1b8bee2ddfcda56afd41612a2e3d36b6a Parents: c10bde3 76c9aba Author: Stephen Mallette Authored: Wed Oct 3 06:12:56 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 06:12:56 2018 -0400 -- .../traversal/dsl/graph/GraphTraversal.java | 48 .../step/sideEffect/SideEffectCapStep.java | 4 +- 2 files changed, 30 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650f31f1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java --
[04/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Added support for special Double values
TINKERPOP-2055 Added support for special Double values Includes Nan and the infinity values. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/afc12bd2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/afc12bd2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/afc12bd2 Branch: refs/heads/TINKERPOP-2053 Commit: afc12bd27bc9c4c26b3ba2594c4c0810d5d76421 Parents: e7af98b Author: Stephen Mallette Authored: Tue Oct 2 15:35:53 2018 -0400 Committer: Stephen Mallette Committed: Tue Oct 2 15:35:53 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/GraphSONSerializersV2d0.java | 19 --- .../graphson/GraphSONMapperEmbeddedTypeTest.java | 15 +++ 3 files changed, 32 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e93c1c9..33d35d3 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -37,6 +37,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Added support for GraphSON serialization of `Date` in Javascript. * Added synchronized `Map` to Gryo 1.0 registrations. * Added `Triple` to Gryo 1.0 registrations. +* Added support for `Double.NaN`, `Double.POSITIVE_INFINITY` and `Double.NEGATIVE_INFINITY`. * Improved escaping of special characters in strings passed to the `GroovyTranslator`. * Added better internal processing of `Column` in `by(Function)`. * Added `hasNext()` support on `Traversal` for `gremlin-python`. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java index 2ddb37a..177e2d0 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV2d0.java @@ -677,7 +677,7 @@ class GraphSONSerializersV2d0 { } @Override -public Integer deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +public Integer deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { return jsonParser.getIntValue(); } @@ -694,8 +694,21 @@ class GraphSONSerializersV2d0 { } @Override -public Double deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { -return jsonParser.getDoubleValue(); +public Double deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext) throws IOException, JsonProcessingException { +if (jsonParser.getCurrentToken().isNumeric()) +return jsonParser.getDoubleValue(); +else { +final String numberText = jsonParser.getValueAsString(); +if ("NaN".equalsIgnoreCase(numberText)) +return Double.NaN; +else if ("-Infinity".equals(numberText) || "-INF".equalsIgnoreCase(numberText)) +return Double.NEGATIVE_INFINITY; +else if ("Infinity".equals(numberText) || "INF".equals(numberText)) +return Double.POSITIVE_INFINITY; +else +throw new IllegalStateException("Double value unexpected: " + numberText); +} + } @Override http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/afc12bd2/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java index 9079c8a..e5f2693 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapperEmbeddedTypeTest.java +++
[03/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b788201b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b788201b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b788201b Branch: refs/heads/TINKERPOP-2053 Commit: b788201bfcc0bd4f2a5eb24a66d32be58d06583d Parents: 3a91712 c10bde3 Author: Robert Dale Authored: Tue Oct 2 09:44:55 2018 -0400 Committer: Robert Dale Committed: Tue Oct 2 09:44:55 2018 -0400 -- docs/postprocessor/processor.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[47/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Bumped gryo reg id for OptionsStrategy
TINKERPOP-2053 Bumped gryo reg id for OptionsStrategy Expecting TINKERPOP-2041 to merge first which is using 186 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a1e20992 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a1e20992 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a1e20992 Branch: refs/heads/TINKERPOP-2053 Commit: a1e20992241ab5042b8902fcea58fbdd2783d787 Parents: 431f8c5 Author: Stephen Mallette Authored: Tue Oct 2 14:36:27 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- .../apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1e20992/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java index d2c21d2..10f99ac 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java @@ -341,7 +341,7 @@ public enum GryoVersion { add(GryoTypeReg.of(LazyBarrierStrategy.class, 150)); add(GryoTypeReg.of(MatchPredicateStrategy.class, 151)); add(GryoTypeReg.of(OrderLimitStrategy.class, 152)); -add(GryoTypeReg.of(OptionsStrategy.class, 186)); // ***LAST ID*** +add(GryoTypeReg.of(OptionsStrategy.class, 187)); // ***LAST ID*** add(GryoTypeReg.of(PathProcessorStrategy.class, 153)); add(GryoTypeReg.of(PathRetractionStrategy.class, 154)); add(GryoTypeReg.of(CountStrategy.class, 155)); @@ -575,7 +575,7 @@ public enum GryoVersion { add(GryoTypeReg.of(LazyBarrierStrategy.class, 150)); add(GryoTypeReg.of(MatchPredicateStrategy.class, 151)); add(GryoTypeReg.of(OrderLimitStrategy.class, 152)); -add(GryoTypeReg.of(OptionsStrategy.class, 186)); // ***LAST ID*** +add(GryoTypeReg.of(OptionsStrategy.class, 187)); // ***LAST ID*** add(GryoTypeReg.of(PathProcessorStrategy.class, 153)); add(GryoTypeReg.of(PathRetractionStrategy.class, 154)); add(GryoTypeReg.of(CountStrategy.class, 155));
[37/50] [abbrv] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e330ad67 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e330ad67 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e330ad67 Branch: refs/heads/TINKERPOP-2053 Commit: e330ad67d142316276624617015d3cc477c1ecad Parents: 9e40789 5b9b81f Author: Stephen Mallette Authored: Thu Oct 4 14:53:46 2018 -0400 Committer: Stephen Mallette Committed: Thu Oct 4 14:53:46 2018 -0400 -- CHANGELOG.asciidoc | 1 + docs/src/dev/io/graphson.asciidoc | 2 + .../structure/io/graphson/GraphSONModule.java | 2 +- .../io/graphson/GraphSONSerializersV2d0.java| 19 ++-- .../io/graphson/GraphSONSerializersV3d0.java| 23 +++--- .../GraphSONMapperEmbeddedTypeTest.java | 14 ++ .../IO/GraphSON/GraphSONReaderTests.cs | 48 +--- .../IO/GraphSON/GraphSONWriterTests.cs | 32 - .../lib/structure/io/type-serializers.js| 30 +++- .../test/unit/graphson-test.js | 39 .../gremlin_python/structure/io/graphsonV2d0.py | 26 +++ .../gremlin_python/structure/io/graphsonV3d0.py | 26 +++ .../tests/structure/io/test_graphsonV2d0.py | 25 ++ .../tests/structure/io/test_graphsonV3d0.py | 22 + 14 files changed, 290 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/docs/src/dev/io/graphson.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV2d0.py -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e330ad67/gremlin-python/src/main/jython/tests/structure/io/test_graphsonV3d0.py --
[29/50] [abbrv] tinkerpop git commit: Renamed `TP` to `TextP` as proposed by @robertdale
Renamed `TP` to `TextP` as proposed by @robertdale Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f057fb36 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f057fb36 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f057fb36 Branch: refs/heads/TINKERPOP-2053 Commit: f057fb3601ab12dfe8dc10361c9916c904fc5a0d Parents: 79d4a05 Author: Daniel Kuppitz Authored: Mon Oct 1 09:27:35 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 16 +-- docs/src/upgrade/release-3.4.x.asciidoc | 2 +- .../tinkerpop/gremlin/jsr223/CoreImports.java | 6 +- .../tinkerpop/gremlin/process/traversal/TP.java | 107 --- .../gremlin/process/traversal/TextP.java| 107 +++ .../structure/io/graphson/GraphSONModule.java | 10 +- .../io/graphson/TraversalSerializersV2d0.java | 12 +-- .../io/graphson/TraversalSerializersV3d0.java | 12 +-- .../structure/io/gryo/GryoSerializersV1d0.java | 10 +- .../structure/io/gryo/GryoSerializersV3d0.java | 10 +- .../gremlin/structure/io/gryo/GryoVersion.java | 6 +- .../gremlin/process/traversal/PTest.java| 28 ++--- .../GraphSONMapperPartialEmbeddedTypeTest.java | 16 +-- gremlin-dotnet/glv/TP.template | 71 gremlin-dotnet/glv/TextP.template | 71 gremlin-dotnet/glv/generate.groovy | 12 +-- .../src/Gremlin.Net/Process/Traversal/TP.cs | 96 - .../src/Gremlin.Net/Process/Traversal/TextP.cs | 96 + .../Structure/IO/GraphSON/GraphSONWriter.cs | 2 +- .../Structure/IO/GraphSON/TPSerializer.cs | 45 .../Structure/IO/GraphSON/TextPSerializer.cs| 45 .../Gherkin/TraversalEvaluation/TPParameter.cs | 97 - .../TraversalEvaluation/TextPParameter.cs | 97 + .../TraversalEvaluation/TraversalParser.cs | 6 +- .../gremlin/groovy/jsr223/GroovyTranslator.java | 8 +- gremlin-javascript/glv/TraversalSource.template | 6 +- gremlin-javascript/glv/generate.groovy | 6 +- .../main/javascript/gremlin-javascript/index.js | 2 +- .../gremlin-javascript/lib/process/traversal.js | 6 +- .../lib/structure/io/graph-serializer.js| 4 +- .../lib/structure/io/type-serializers.js| 10 +- .../test/cucumber/feature-steps.js | 2 +- gremlin-python/glv/TraversalSource.template | 6 +- gremlin-python/glv/generate.groovy | 6 +- .../gremlin/python/jsr223/PythonTranslator.java | 8 +- .../jython/gremlin_python/process/traversal.py | 26 ++--- .../gremlin_python/structure/io/graphsonV2d0.py | 8 +- .../gremlin_python/structure/io/graphsonV3d0.py | 8 +- .../src/main/jython/radish/feature_steps.py | 4 +- gremlin-test/features/filter/Has.feature| 10 +- .../process/traversal/step/filter/HasTest.java | 12 +-- 41 files changed, 556 insertions(+), 556 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f057fb36/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index da7260c..fdd261a 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -3357,8 +3357,8 @@ interface. Steps that allow for this type of modulation will explicitly state so == A Note on Predicates A `P` is a predicate of the form `Function`. That is, given some object, return true or false. As of -the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TP` -text predicates extends the `P` predicates, but are specialized in that they are of the form `Function`. +the relase of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TextP` +text predicates extend the `P` predicates, but are specialized in that they are of the form `Function`. The provided predicates are outlined in the table below and are used in various steps such as <>-step, <>-step, <>-step, etc. @@ -3376,12 +3376,12 @@ The provided predicates are outlined in the table below and are used in various | `P.between(number,number)` | Is the incoming number greater than or equal to the first provided number and less than the second? | `P.within(objects...)` | Is the incoming object in the array of provided objects? | `P.without(objects...)` | Is the incoming object not in the array of the provided objects? -| `TP.startsWith(string)` | Does the incoming `String` start with the
[08/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Updated IO docs to include special numbers
TINKERPOP-2055 Updated IO docs to include special numbers Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a083fbff Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a083fbff Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a083fbff Branch: refs/heads/TINKERPOP-2053 Commit: a083fbff62fcc38a3dae9b138f56b0d052e0c143 Parents: b542027 Author: Stephen Mallette Authored: Wed Oct 3 05:30:27 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 05:30:27 2018 -0400 -- docs/src/dev/io/graphson.asciidoc | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a083fbff/docs/src/dev/io/graphson.asciidoc -- diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc index c120634..064ac2e 100644 --- a/docs/src/dev/io/graphson.asciidoc +++ b/docs/src/dev/io/graphson.asciidoc @@ -1491,6 +1491,8 @@ types. By default, TinkerPop types will have the namespace "g" (or "gx" for "ext Double +While the `@value` is expected to be a JSON number, it might also be a `String` of `NaN`, `Infinity` or `-Infinity`. + [source,json] {
[19/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-2040' into tp32
Merge branch 'TINKERPOP-2040' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/88d6f778 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/88d6f778 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/88d6f778 Branch: refs/heads/TINKERPOP-2053 Commit: 88d6f778694e6c65ddde6fdcc18948327e01914a Parents: fcbce50 92c74c3 Author: Stephen Mallette Authored: Wed Oct 3 15:28:58 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 15:28:58 2018 -0400 -- CHANGELOG.asciidoc | 2 + .../gremlin/jsr223/TranslatorCustomizer.java| 38 .../gremlin/process/traversal/Translator.java | 34 +++ .../groovy/jsr223/GroovyTranslatorTest.java | 213 --- .../jsr223/GremlinGroovyScriptEngine.java | 15 +- .../gremlin/groovy/jsr223/GroovyTranslator.java | 34 ++- 6 files changed, 301 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/88d6f778/CHANGELOG.asciidoc --
[02/50] [abbrv] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c10bde33 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c10bde33 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c10bde33 Branch: refs/heads/TINKERPOP-2053 Commit: c10bde339bba6fccee3e28a6ceb59d937a910986 Parents: 7148a4b e7af98b Author: Robert Dale Authored: Tue Oct 2 09:44:45 2018 -0400 Committer: Robert Dale Committed: Tue Oct 2 09:44:45 2018 -0400 -- docs/postprocessor/processor.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[06/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Added special number handling in javascript
TINKERPOP-2055 Added special number handling in javascript Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d3041f2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d3041f2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d3041f2 Branch: refs/heads/TINKERPOP-2053 Commit: 2d3041f226310379c966214461c79cf47432f4c9 Parents: 854914e Author: Stephen Mallette Authored: Wed Oct 3 04:33:40 2018 -0400 Committer: Stephen Mallette Committed: Wed Oct 3 04:33:40 2018 -0400 -- .../lib/structure/io/type-serializers.js| 30 ++- .../test/unit/graphson-test.js | 39 2 files changed, 67 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d3041f2/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js index fdf049f..5583c47 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js @@ -49,11 +49,37 @@ class TypeSerializer { class NumberSerializer extends TypeSerializer { serialize(item) { -return item; +if (isNaN(item)) { + return { +[typeKey]: 'g:Double', +[valueKey]: 'NaN' + }; +} else if (item === Number.POSITIVE_INFINITY) { + return { +[typeKey]: 'g:Double', +[valueKey]: 'Infinity' + }; +} else if (item === Number.NEGATIVE_INFINITY) { + return { +[typeKey]: 'g:Double', +[valueKey]: '-Infinity' + }; +} else { + return item; +} } deserialize(obj) { -return parseFloat(obj[valueKey]); +var val = obj[valueKey]; +if (val === 'NaN') { + return NaN; +} else if (val === 'Infinity') { + return Number.POSITIVE_INFINITY; +} else if (val === '-Infinity') { + return Number.NEGATIVE_INFINITY; +} else { + return parseFloat(val); +} } canBeUsedFor(value) { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d3041f2/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js index b459407..a1ac0d6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/graphson-test.js @@ -46,6 +46,30 @@ describe('GraphSONReader', function () { assert.strictEqual(result, item[1]); }); }); + it('should parse GraphSON Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "NaN" + }); + assert.ok(isNaN(result)); + }); + it('should parse GraphSON -Infinity and Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "-Infinity" + }); + assert.strictEqual(result, Number.NEGATIVE_INFINITY); + }); + it('should parse GraphSON Infinity and Nan from GraphSON', function () { + const reader = new GraphSONReader(); + var result = reader.read({ +"@type": "g:Double", +"@value": "Infinity" + }); + assert.strictEqual(result, Number.POSITIVE_INFINITY); + }); it('should parse Date', function() { const obj = { "@type" : "g:Date", "@value" : 1481750076295 }; const reader = new GraphSONReader(); @@ -102,6 +126,21 @@ describe('GraphSONWriter', function () { const writer = new GraphSONWriter(); assert.strictEqual(writer.write(2), '2'); }); + it('should write NaN', function () { +const writer = new GraphSONWriter(); +const expected = JSON.stringify({ "@type" : "g:Double", "@value" : "NaN" }); +assert.strictEqual(writer.write(NaN), expected); + }); + it('should write Infinity', function () { +const writer = new GraphSONWriter(); +const expected = JSON.stringify({ "@type" : "g:Double", "@value" : "Infinity" }); +assert.strictEqual(writer.write(Number.POSITIVE_INFINITY), expected); + }); + it('should write
[44/50] [abbrv] tinkerpop git commit: This closes #922
This closes #922 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/813ab73e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/813ab73e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/813ab73e Branch: refs/heads/TINKERPOP-2053 Commit: 813ab73e6c88dc12cfeca1bf16b22cce9ed4bd3e Parents: 73444c3 Author: Stephen Mallette Authored: Fri Oct 5 08:48:04 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 08:48:04 2018 -0400 -- --
[01/50] [abbrv] tinkerpop git commit: Asciidoc puts an extra space on the-traversal line 162: g.addV('person').iterate() <9> - CTR [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-2053 8d78dbd7f -> a1e209922 (forced update) Asciidoc puts an extra space on the-traversal line 162: g.addV('person').iterate() <9> - CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e7af98bf Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e7af98bf Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e7af98bf Branch: refs/heads/TINKERPOP-2053 Commit: e7af98bf848df812750d6844d6af156a7eaaca27 Parents: d0659bd Author: Robert Dale Authored: Tue Oct 2 06:00:09 2018 -0400 Committer: Robert Dale Committed: Tue Oct 2 06:00:09 2018 -0400 -- docs/postprocessor/processor.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e7af98bf/docs/postprocessor/processor.awk -- diff --git a/docs/postprocessor/processor.awk b/docs/postprocessor/processor.awk index 18ada47..fbeadcc 100644 --- a/docs/postprocessor/processor.awk +++ b/docs/postprocessor/processor.awk @@ -42,7 +42,7 @@ BEGIN { // { if (firstMatch || !isHeader) { -print gensub(/\/\/<\/span>()\(([0-9]+)\)(<\/b>)/, +print gensub(/\/\/<\/span>[ ]*()\(([0-9]+)\)(<\/b>)/, "//\\1\\2\\3<\/span>", "g") } }
[25/50] [abbrv] tinkerpop git commit: TINKERPOP-2041 Fixed gremlin-javascript serializers for TP
TINKERPOP-2041 Fixed gremlin-javascript serializers for TP Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/68c47afa Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/68c47afa Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/68c47afa Branch: refs/heads/TINKERPOP-2053 Commit: 68c47afa017deb9deabba1cf025ecddd68cd42fa Parents: 519ca65 Author: Stephen Mallette Authored: Thu Sep 27 16:33:26 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- .../gremlin-javascript/lib/structure/io/graph-serializer.js| 2 ++ .../gremlin-javascript/lib/structure/io/type-serializers.js| 1 + 2 files changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68c47afa/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js index 9ce1761..fca8375 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js @@ -162,6 +162,7 @@ const deserializers = { 'g:Property': typeSerializers.PropertySerializer, 'g:Path': typeSerializers.Path3Serializer, 'g:T': typeSerializers.TSerializer, + 'g:TP': typeSerializers.TPSerializer, 'g:List': typeSerializers.ListSerializer, 'g:Set': typeSerializers.SetSerializer, 'g:Map': typeSerializers.MapSerializer @@ -173,6 +174,7 @@ const serializers = [ typeSerializers.BytecodeSerializer, typeSerializers.TraverserSerializer, typeSerializers.PSerializer, + typeSerializers.TPSerializer, typeSerializers.LambdaSerializer, typeSerializers.EnumSerializer, typeSerializers.VertexSerializer, http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68c47afa/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js index ca81c2a..576c721 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js @@ -406,6 +406,7 @@ module.exports = { PathSerializer, PropertySerializer, PSerializer, + TPSerializer, SetSerializer, TSerializer, TraverserSerializer,
[27/50] [abbrv] tinkerpop git commit: TINKERPOP-2041 Fixed .NET tests around TP predicates
TINKERPOP-2041 Fixed .NET tests around TP predicates Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/79d4a056 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/79d4a056 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/79d4a056 Branch: refs/heads/TINKERPOP-2053 Commit: 79d4a056e311971c765bf1b9bd84b48582df7698 Parents: 68c47af Author: Stephen Mallette Authored: Fri Sep 28 08:27:25 2018 -0400 Committer: Daniel Kuppitz Committed: Thu Oct 4 07:45:08 2018 -0700 -- .../src/Gremlin.Net/Process/Traversal/TP.cs | 2 +- .../Gherkin/TraversalEvaluation/TPParameter.cs | 97 .../TraversalEvaluation/TraversalParser.cs | 4 + 3 files changed, 102 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/79d4a056/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs index ac6415d..abebd1e 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/TP.cs @@ -39,7 +39,7 @@ namespace Gremlin.Net.Process.Traversal public class TP : P { /// -/// Initializes a new instance of the class. +/// Initializes a new instance of the class. /// /// The name of the predicate. /// The value of the predicate. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/79d4a056/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs new file mode 100644 index 000..9100c6f --- /dev/null +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TPParameter.cs @@ -0,0 +1,97 @@ +#region License + +/* + * 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. + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Reflection; +using Gremlin.Net.Process.Traversal; + +namespace Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation +{ +/// +/// Represents a parameter for a traversal predicate (ie: TP.contains()) +/// +internal class TPParameter : ITokenParameter, IEquatable +{ +private IDictionary _contextParameterValues; +public IList Tokens { get; } + +public TPParameter(IList tokens) +{ +Tokens = tokens; +} + +public bool Equals(TPParameter other) +{ +return Tokens.SequenceEqual(other.Tokens); +} + +public override bool Equals(object obj) +{ +if (ReferenceEquals(null, obj)) return false; +if (ReferenceEquals(this, obj)) return true; +if (obj.GetType() != GetType()) return false; +return Equals((TPParameter) obj); +} + +public override int GetHashCode() +{ +return Tokens != null ? Tokens.GetHashCode() : 0; +} + +public object GetValue() +{ +var type = typeof(TP); +object instance = null; +for (var i = 1; i < Tokens.Count; i++) +{ +var token = Tokens[i]; +token.SetContextParameterValues(_contextParameterValues); +var method = type.GetMethod(TraversalParser.GetCsharpName(token.Name), +BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public); +if (method == null) +{ +throw new InvalidOperationException($"Predicate (TP) method '{token}' not found for testing"); +
[45/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Added upgrade docs for OptionsStrategy
TINKERPOP-2053 Added upgrade docs for OptionsStrategy Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/57f76f83 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/57f76f83 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/57f76f83 Branch: refs/heads/TINKERPOP-2053 Commit: 57f76f83a3d72316ffa8371fa93fddd10a83fb8e Parents: f134c8a Author: Stephen Mallette Authored: Tue Oct 2 13:55:21 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- docs/src/upgrade/release-3.4.x.asciidoc | 21 + 1 file changed, 21 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57f76f83/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 21e1899..a961575 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -483,6 +483,27 @@ All of the changes above basically mean, that if the `Mutating` interface was be See: link:https://issues.apache.org/jira/browse/TINKERPOP-1975[TINKERPOP-1975] += OptionsStrategy + +`OptionsStrategy` is a `TraversalStrategy` that makes it possible for users to set arbitrary configurations on a +`Traversal`. These configurations can be used by graph providers to allow for traversal-level configurations to be +accessible to their custom steps. A user would write something like: + +[source,java] + +g.withStrategies(OptionsStrategy.build().with("specialLimit", 1).create()); + + +The graph provider could then access that value of "specialLimit" in their custom step (or elsewhere) as follows: + +[source,java] + +OptionsStrategy strategy = this.getTraversal().asAdmin().getStrategies().getStrategy(OptionsStrategy.class).get(); +int specialLimit = (int) strategy.getOptions().get("specialLimit"); + + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-2053[TINKERPOP-2053] + = Removed hadoop-gremlin Test Artifact The `hadoop-gremlin` module no longer generates a test jar that can be used as a test dependency in other modules.
[48/50] [abbrv] tinkerpop git commit: TINKERPOP-2053 Added OptionsStrategy to gryo registrations
TINKERPOP-2053 Added OptionsStrategy to gryo registrations Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/431f8c5d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/431f8c5d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/431f8c5d Branch: refs/heads/TINKERPOP-2053 Commit: 431f8c5ddef2833cb4627da611c148f29691cfb2 Parents: 57f76f8 Author: Stephen Mallette Authored: Tue Oct 2 14:35:10 2018 -0400 Committer: Stephen Mallette Committed: Fri Oct 5 10:30:19 2018 -0400 -- .../apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/431f8c5d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java index 0829fbb..d2c21d2 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoVersion.java @@ -48,6 +48,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy; @@ -340,6 +341,7 @@ public enum GryoVersion { add(GryoTypeReg.of(LazyBarrierStrategy.class, 150)); add(GryoTypeReg.of(MatchPredicateStrategy.class, 151)); add(GryoTypeReg.of(OrderLimitStrategy.class, 152)); +add(GryoTypeReg.of(OptionsStrategy.class, 186)); // ***LAST ID*** add(GryoTypeReg.of(PathProcessorStrategy.class, 153)); add(GryoTypeReg.of(PathRetractionStrategy.class, 154)); add(GryoTypeReg.of(CountStrategy.class, 155)); @@ -573,6 +575,7 @@ public enum GryoVersion { add(GryoTypeReg.of(LazyBarrierStrategy.class, 150)); add(GryoTypeReg.of(MatchPredicateStrategy.class, 151)); add(GryoTypeReg.of(OrderLimitStrategy.class, 152)); +add(GryoTypeReg.of(OptionsStrategy.class, 186)); // ***LAST ID*** add(GryoTypeReg.of(PathProcessorStrategy.class, 153)); add(GryoTypeReg.of(PathRetractionStrategy.class, 154)); add(GryoTypeReg.of(CountStrategy.class, 155));
[05/50] [abbrv] tinkerpop git commit: TINKERPOP-2055 Support for special numbers in python
TINKERPOP-2055 Support for special numbers in python Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/854914e6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/854914e6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/854914e6 Branch: refs/heads/TINKERPOP-2053 Commit: 854914e6e3adbf7f0854eb0fec0c3a38b61d4644 Parents: afc12bd Author: Stephen Mallette Authored: Tue Oct 2 16:55:50 2018 -0400 Committer: Stephen Mallette Committed: Tue Oct 2 16:55:50 2018 -0400 -- .../gremlin_python/structure/io/graphson.py | 26 .../jython/tests/structure/io/test_graphson.py | 25 +++ 2 files changed, 51 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/854914e6/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 24e86bb..f3411ba 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 @@ -20,6 +20,7 @@ import datetime import json import time import uuid +import math from collections import OrderedDict import six @@ -381,6 +382,31 @@ class FloatIO(_NumberIO): graphson_type = "g:Float" graphson_base_type = "Float" +@classmethod +def dictify(cls, n, writer): +if isinstance(n, bool): # because isinstance(False, int) and isinstance(True, int) +return n +elif math.isnan(n): +return GraphSONUtil.typedValue(cls.graphson_base_type, "NaN") +elif math.isinf(n) and n > 0: +return GraphSONUtil.typedValue(cls.graphson_base_type, "Infinity") +elif math.isinf(n) and n < 0: +return GraphSONUtil.typedValue(cls.graphson_base_type, "-Infinity") +else: +return GraphSONUtil.typedValue(cls.graphson_base_type, n) + +@classmethod +def objectify(cls, v, _): +if isinstance(v, str): +if v == 'NaN': +return float('nan') +elif v == "Infinity": +return float('inf') +elif v == "-Infinity": +return float('-inf') + +return cls.python_type(v) + class DoubleIO(FloatIO): graphson_type = "g:Double" http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/854914e6/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py -- diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py index 928b33f..37e99c6 100644 --- a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py +++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py @@ -22,6 +22,7 @@ import datetime import time import json import uuid +import math from mock import Mock @@ -70,6 +71,27 @@ class TestGraphSONReader(object): })) assert isinstance(x, float) assert 31.2 == x +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "NaN" +})) +assert isinstance(x, float) +assert math.isnan(x) +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "Infinity" +})) +assert isinstance(x, float) +assert math.isinf(x) and x > 0 +## +x = self.graphson_reader.readObject(json.dumps({ +"@type": "g:Double", +"@value": "-Infinity" +})) +assert isinstance(x, float) +assert math.isinf(x) and x < 0 def test_graph(self): vertex = self.graphson_reader.readObject( @@ -163,6 +185,9 @@ class TestGraphSONWriter(object): assert {"@type": "g:Int64", "@value": 2} == json.loads(self.graphson_writer.writeObject(long(2))) assert {"@type": "g:Int32", "@value": 1} == json.loads(self.graphson_writer.writeObject(1)) assert {"@type": "g:Double", "@value": 3.2} == json.loads(self.graphson_writer.writeObject(3.2)) +assert {"@type": "g:Double", "@value": "NaN"} == json.loads(self.graphson_writer.writeObject(float('nan'))) +assert {"@type": "g:Double", "@value": "Infinity"} == json.loads(self.graphson_writer.writeObject(float('inf'))) +assert {"@type": "g:Double", "@value": "-Infinity"} == json.loads(self.graphson_writer.writeObject(float('-inf'))) assert """true""" ==