[33/50] [abbrv] tinkerpop git commit: TINKERPOP-1936 Implemented bytecode serialization performance enhancement for GraphSON 3.0
TINKERPOP-1936 Implemented bytecode serialization performance enhancement for 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/7e6e9854 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7e6e9854 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7e6e9854 Branch: refs/heads/TINKERPOP-1869 Commit: 7e6e98548625c83ad419737166fe6c679d204468 Parents: b8b46b0 Author: Stephen MalletteAuthored: Fri Apr 20 19:26:05 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:26:05 2018 -0400 -- .../io/graphson/TraversalSerializersV3d0.java | 33 ++-- 1 file changed, 23 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7e6e9854/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java index fd11f25..eaa7b0f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java @@ -252,17 +252,30 @@ final class TraversalSerializersV3d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the start array +jsonParser.nextToken(); + +final String stepName = jsonParser.getText(); + +// iterate through the rest of the list for arguments until it gets to the end +final List arguments = new ArrayList<>(); +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { +// we don't know the types here, so let the deserializer figure that business out + arguments.add(deserializationContext.readValue(jsonParser, Object.class)); +} + +// if it's not a "source" then it must be a "step" +if (current.equals(GraphSONTokens.SOURCE)) +bytecode.addSource(stepName, arguments.toArray()); +else +bytecode.addStep(stepName, arguments.toArray()); } } }
[39/50] [abbrv] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json new file mode 100644 index 000..24e95ed --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json @@ -0,0 +1,829 @@ +{ + "@type" : "tinker:graph", + "@value" : { +"vertices" : [ { + "@type" : "g:Vertex", + "@value" : { +"id" : { + "@type" : "g:Int32", + "@value" : 1 +}, +"label" : "person", +"properties" : { + "name" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 0 + }, + "value" : "marko", + "label" : "name" +} + } ], + "location" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 6 + }, + "value" : "san diego", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 1997 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2001 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 7 + }, + "value" : "santa cruz", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2001 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2004 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 8 + }, + "value" : "brussels", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2004 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2005 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 9 + }, + "value" : "santa fe", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2005 +} + } +} + } ] +} + } +}, { + "@type" : "g:Vertex", + "@value" : { +"id" : { + "@type" : "g:Int32", + "@value" : 7 +}, +"label" : "person", +"properties" : { + "name" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 1 + }, + "value" : "stephen", + "label" : "name" +} + } ], + "location" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 10 + }, + "value" : "centreville", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 1990 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2000 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 11 + }, + "value" : "dulles", + "label" : "location", +
[14/50] [abbrv] tinkerpop git commit: set version on build-helper-maven-plugin to stabalize maven build - CTR
set version on build-helper-maven-plugin to stabalize maven build - CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/01c89549 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/01c89549 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/01c89549 Branch: refs/heads/TINKERPOP-1869 Commit: 01c89549bf9e036c40c53245adb523b6cd85926a Parents: 5f81504 Author: Robert DaleAuthored: Sat Apr 14 20:35:49 2018 -0400 Committer: Robert Dale Committed: Sat Apr 14 20:35:49 2018 -0400 -- pom.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/01c89549/pom.xml -- diff --git a/pom.xml b/pom.xml index 17fdec8..9ffd294 100644 --- a/pom.xml +++ b/pom.xml @@ -357,6 +357,7 @@ limitations under the License. org.codehaus.mojo build-helper-maven-plugin + 3.0.0 parse-version
[35/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/81add608 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/81add608 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/81add608 Branch: refs/heads/TINKERPOP-1869 Commit: 81add608549846e5f45e4e1a504e5e3cea6e03f9 Parents: 7e6e985 682f298 Author: Stephen MalletteAuthored: Fri Apr 20 19:29:17 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:29:17 2018 -0400 -- --
[46/50] [abbrv] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/TINKERPOP-1869 Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[50/50] [abbrv] tinkerpop git commit: TINKERPOP-1869 Allowed iterate() after profile()
TINKERPOP-1869 Allowed iterate() after profile() The iterate() method adds a NoneStep that was preventing traversals like g.V().profile().iterate(). Not the typical type of traversal you would do, but it seems like it should be allowed for consistency sake. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/374b51a3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/374b51a3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/374b51a3 Branch: refs/heads/TINKERPOP-1869 Commit: 374b51a3fcb58ee6a7601b32d80ccd1e7a680f6a Parents: 8005cb3 Author: Stephen MalletteAuthored: Tue Apr 24 19:07:28 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 19:07:28 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../StandardVerificationStrategy.java | 13 --- .../StandardVerificationStrategyTest.java | 41 +--- 3 files changed, 36 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/374b51a3/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index aead6ef..5265bd4 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,7 @@ This release also includes changes from < >. * Coerced `BulkSet` to `g:List` in GraphSON 3.0. * Deprecated `CredentialsGraph` DSL in favor of `CredentialsTraversalDsl` which uses the recommended method for Gremlin DSL development. +* Allowed `iterate()` to be called after `profile()`. [[release-3-3-2]] === TinkerPop 3.3.2 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/374b51a3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java index cad3b8e..0fa7f5a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java @@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NoneStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileSideEffectStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep; @@ -63,15 +64,17 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg throw new VerificationException("The parent of a reducing barrier can not be repeat()-step: " + step, traversal); } -// The ProfileSideEffectStep must be the last step, 2nd last step when accompanied by the cap step, -// or 3rd to last when the traversal ends with a RequirementsStep. +// The ProfileSideEffectStep must be one of the following +// (1) the last step +// (2) 2nd last step when accompanied by the cap step or none step (i.e. iterate() to nothing) +// (3) 3rd to last when the traversal ends with a RequirementsStep. final Step endStep = traversal.asAdmin().getEndStep(); if (TraversalHelper.hasStepOfClass(ProfileSideEffectStep.class, traversal) && !(endStep instanceof ProfileSideEffectStep || (endStep instanceof SideEffectCapStep && endStep.getPreviousStep() instanceof ProfileSideEffectStep) || -(endStep instanceof RequirementsStep && ( -endStep.getPreviousStep() instanceof SideEffectCapStep || -endStep.getPreviousStep() instanceof ProfileSideEffectStep { +(endStep instanceof NoneStep && endStep.getPreviousStep() instanceof SideEffectCapStep && endStep.getPreviousStep().getPreviousStep() instanceof ProfileSideEffectStep) || +(endStep instanceof RequirementsStep &&
[23/50] [abbrv] tinkerpop git commit: Added gremlin-javascript logo CTR
Added gremlin-javascript logo CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6ac22741 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6ac22741 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6ac22741 Branch: refs/heads/TINKERPOP-1869 Commit: 6ac22741d21488e35784dafdb05ca89eb80967af Parents: 4dcee1a Author: Stephen MalletteAuthored: Thu Apr 19 07:09:02 2018 -0400 Committer: Stephen Mallette Committed: Thu Apr 19 07:09:02 2018 -0400 -- docs/static/images/gremlin-js.png | Bin 0 -> 78981 bytes 1 file changed, 0 insertions(+), 0 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6ac22741/docs/static/images/gremlin-js.png -- diff --git a/docs/static/images/gremlin-js.png b/docs/static/images/gremlin-js.png new file mode 100755 index 000..925ef36 Binary files /dev/null and b/docs/static/images/gremlin-js.png differ
[22/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/028aba45 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/028aba45 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/028aba45 Branch: refs/heads/TINKERPOP-1869 Commit: 028aba45cd268ba675711866e3633125dc74ef19 Parents: 358f99b 4dcee1a Author: Stephen MalletteAuthored: Wed Apr 18 18:50:22 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 18 18:50:22 2018 -0400 -- .../process/traversal/step/util/Parameters.java | 16 ++-- .../driver/remote/DriverRemoteTraversal.java| 6 +++--- 2 files changed, 9 insertions(+), 13 deletions(-) --
[32/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/b8b46b06 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b8b46b06 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b8b46b06 Branch: refs/heads/TINKERPOP-1869 Commit: b8b46b06a26c58395ef2d878c2c2ed0665c0e788 Parents: 4705c04 6b259f7 Author: Stephen MalletteAuthored: Fri Apr 20 19:03:42 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:03:42 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8b46b06/CHANGELOG.asciidoc --
[12/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1912' into TINKERPOP-1912-tp33
Merge branch 'TINKERPOP-1912' into TINKERPOP-1912-tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c31aa581 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c31aa581 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c31aa581 Branch: refs/heads/TINKERPOP-1869 Commit: c31aa581a87bfa5b6eb635c7eaa35a15ba5afb47 Parents: a4b7ac4 54df6dc Author: Daniel KuppitzAuthored: Thu Apr 12 11:02:30 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Apr 12 11:02:30 2018 -0700 -- bin/validate-distribution.sh| 3 ++- docs/src/dev/developer/release.asciidoc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c31aa581/docs/src/dev/developer/release.asciidoc --
[24/50] [abbrv] tinkerpop git commit: Added gremlin-javascript logo to docs CTR
Added gremlin-javascript logo to docs CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b99c56a6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b99c56a6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b99c56a6 Branch: refs/heads/TINKERPOP-1869 Commit: b99c56a6e50a86d6c3d2a0d12dbcac946e4ee2af Parents: 6ac2274 Author: Stephen MalletteAuthored: Thu Apr 19 07:15:33 2018 -0400 Committer: Stephen Mallette Committed: Thu Apr 19 07:15:33 2018 -0400 -- docs/src/reference/gremlin-variants.asciidoc | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b99c56a6/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index c19160a..d929b3c 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -457,10 +457,10 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net [[gremlin-javascript]] == Gremlin-JavaScript - -Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the JavaScript language. It targets Node.js runtime -and can be used on different operating systems on any Node.js 4 or above. Since the JavaScript naming conventions are -very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. +image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch +between Gremlin-Java and Gremlin-JavaScript. [source,bash] npm install gremlin-javascript
[26/50] [abbrv] tinkerpop git commit: Make ResponseExceptions constructor public CTR
Make ResponseExceptions constructor public CTR This makes the ResponseException easier to use in tests for users of Gremlin.Net. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/25913023 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/25913023 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/25913023 Branch: refs/heads/TINKERPOP-1869 Commit: 25913023561f76043e11ff0813b2c8ece57274b5 Parents: b99c56a Author: Florian HockmannAuthored: Thu Apr 19 16:08:03 2018 +0200 Committer: Florian Hockmann Committed: Thu Apr 19 16:08:03 2018 +0200 -- .../src/Gremlin.Net/Driver/Exceptions/ResponseException.cs | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25913023/gremlin-dotnet/src/Gremlin.Net/Driver/Exceptions/ResponseException.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Exceptions/ResponseException.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Exceptions/ResponseException.cs index 4706723..8d26106 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Driver/Exceptions/ResponseException.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Exceptions/ResponseException.cs @@ -30,7 +30,11 @@ namespace Gremlin.Net.Driver.Exceptions /// public class ResponseException : Exception { -internal ResponseException(string message) : base(message) +/// +/// Initializes a new instance of the class. +/// +/// The error message string. +public ResponseException(string message) : base(message) { } }
[29/50] [abbrv] tinkerpop git commit: Refactored SimpleAuthenticator to use the revised Credentials DSL
Refactored SimpleAuthenticator to use the revised Credentials DSL This should have been done on TINKERPOP-1903 but was missed CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1daf3f12 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1daf3f12 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1daf3f12 Branch: refs/heads/TINKERPOP-1869 Commit: 1daf3f12243a9a29ba3a00729a3fe4f2f76eccdd Parents: 38b85d2 Author: Stephen MalletteAuthored: Fri Apr 20 09:26:14 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 09:26:14 2018 -0400 -- .../server/auth/SimpleAuthenticator.java| 32 +--- 1 file changed, 15 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1daf3f12/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java index 8d90bf8..88e4e70 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java @@ -18,17 +18,17 @@ */ package org.apache.tinkerpop.gremlin.server.auth; -import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversal; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversalDsl; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversalSource; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.io.IoCore; import org.apache.tinkerpop.gremlin.structure.util.GraphFactory; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.mindrot.jbcrypt.BCrypt; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; import java.net.InetAddress; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -40,14 +40,14 @@ import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.Credenti /** * A simple implementation of an {@link Authenticator} that uses a {@link Graph} instance as a credential store. - * Management of the credential store can be handled through the {@link CredentialGraph} DSL. + * Management of the credential store can be handled through the {@link CredentialTraversalDsl} DSL. * * @author Stephen Mallette (http://stephen.genoprime.com) */ public class SimpleAuthenticator implements Authenticator { private static final Logger logger = LoggerFactory.getLogger(SimpleAuthenticator.class); private static final byte NUL = 0; -private CredentialGraph credentialStore; +private CredentialTraversalSource credentialStore; /** * The location of the configuration file that contains the credentials database. @@ -82,7 +82,7 @@ public class SimpleAuthenticator implements Authenticator { tinkerGraph.createIndex(PROPERTY_USERNAME, Vertex.class); } -credentialStore = CredentialGraph.credentials(graph); +credentialStore = graph.traversal(CredentialTraversalSource.class); logger.info("CredentialGraph initialized at {}", credentialStore); } @@ -98,17 +98,15 @@ public class SimpleAuthenticator implements Authenticator { final String username = credentials.get(PROPERTY_USERNAME); final String password = credentials.get(PROPERTY_PASSWORD); -try { -user = credentialStore.findUser(username); -} catch (IllegalStateException ex) { -// typically thrown when there are multiple users with the same name in the credential store -logger.warn(ex.getMessage()); -throw new AuthenticationException("Username and/or password are incorrect", ex); -} catch (Exception ex) { -throw new AuthenticationException("Username and/or password are incorrect", ex); -} +final CredentialTraversal t = credentialStore.users(username); +if (!t.hasNext()) +throw new AuthenticationException("Username and/or password are incorrect"); -if (null == user) throw new AuthenticationException("Username and/or password are incorrect"); +user = t.next(); +if (t.hasNext()) { +logger.warn("There is
[27/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/6aa5f2ee Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6aa5f2ee Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6aa5f2ee Branch: refs/heads/TINKERPOP-1869 Commit: 6aa5f2ee3e5a94de975b52b52c9f51fc5cdaa91c Parents: cd1844c 2591302 Author: Florian HockmannAuthored: Thu Apr 19 16:10:24 2018 +0200 Committer: Florian Hockmann Committed: Thu Apr 19 16:10:24 2018 +0200 -- .../src/Gremlin.Net/Driver/Exceptions/ResponseException.cs | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --
[44/50] [abbrv] tinkerpop git commit: Added io test data for 3.2.9. CTR
Added io test data for 3.2.9. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9a586895 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9a586895 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9a586895 Branch: refs/heads/TINKERPOP-1869 Commit: 9a5868959c6dec1c5757198289cbb23068e65a0f Parents: 27778e0 Author: Stephen MalletteAuthored: Mon Apr 23 13:04:12 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 23 13:05:26 2018 -0400 -- .../io/graphson/GraphSONCompatibility.java | 3 + .../structure/io/gryo/GryoCompatibility.java| 1 + .../GraphSONTypedCompatibilityTest.java | 1 + .../GraphSONUntypedCompatibilityTest.java | 2 + .../io/gryo/GryoCompatibilityTest.java | 1 + .../_3_2_9/authenticationchallenge-v1d0.json| 12 + .../authenticationchallenge-v2d0-no-types.json | 12 + .../authenticationchallenge-v2d0-partial.json | 12 + .../_3_2_9/authenticationresponse-v1d0.json | 9 + .../authenticationresponse-v2d0-no-types.json | 9 + .../authenticationresponse-v2d0-partial.json| 9 + .../graphson/_3_2_9/barrier-v2d0-no-types.json | 1 + .../graphson/_3_2_9/barrier-v2d0-partial.json | 4 + .../_3_2_9/bigdecimal-v2d0-partial.json | 1 + .../_3_2_9/biginteger-v2d0-partial.json | 1 + .../graphson/_3_2_9/binding-v2d0-no-types.json | 4 + .../graphson/_3_2_9/binding-v2d0-partial.json | 10 + .../io/graphson/_3_2_9/byte-v2d0-partial.json | 1 + .../_3_2_9/bytebuffer-v2d0-partial.json | 1 + .../graphson/_3_2_9/bytecode-v2d0-no-types.json | 3 + .../graphson/_3_2_9/bytecode-v2d0-partial.json | 6 + .../_3_2_9/cardinality-v2d0-no-types.json | 1 + .../_3_2_9/cardinality-v2d0-partial.json| 4 + .../io/graphson/_3_2_9/char-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/class-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/class-v2d0-partial.json | 4 + .../graphson/_3_2_9/column-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/column-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/date-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/date-v2d0-partial.json | 4 + .../_3_2_9/direction-v2d0-no-types.json | 1 + .../graphson/_3_2_9/direction-v2d0-partial.json | 4 + .../graphson/_3_2_9/double-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/double-v2d0-partial.json | 4 + .../graphson/_3_2_9/duration-v2d0-partial.json | 1 + .../structure/io/graphson/_3_2_9/edge-v1d0.json | 12 + .../io/graphson/_3_2_9/edge-v2d0-no-types.json | 14 + .../io/graphson/_3_2_9/edge-v2d0-partial.json | 32 + .../io/graphson/_3_2_9/float-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/float-v2d0-partial.json | 4 + .../_3_2_9/inetaddress-v2d0-partial.json| 1 + .../graphson/_3_2_9/instant-v2d0-partial.json | 1 + .../graphson/_3_2_9/integer-v2d0-no-types.json | 1 + .../graphson/_3_2_9/integer-v2d0-partial.json | 4 + .../graphson/_3_2_9/lambda-v2d0-no-types.json | 5 + .../io/graphson/_3_2_9/lambda-v2d0-partial.json | 8 + .../graphson/_3_2_9/localdate-v2d0-partial.json | 1 + .../_3_2_9/localdatetime-v2d0-partial.json | 1 + .../graphson/_3_2_9/localtime-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/long-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/long-v2d0-partial.json | 4 + .../graphson/_3_2_9/metrics-v2d0-no-types.json | 24 + .../graphson/_3_2_9/metrics-v2d0-partial.json | 54 ++ .../graphson/_3_2_9/monthday-v2d0-partial.json | 1 + .../_3_2_9/offsetdatetime-v2d0-partial.json | 1 + .../_3_2_9/offsettime-v2d0-partial.json | 1 + .../graphson/_3_2_9/operator-v2d0-no-types.json | 1 + .../graphson/_3_2_9/operator-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/order-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/order-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/p-v2d0-no-types.json | 4 + .../io/graphson/_3_2_9/p-v2d0-partial.json | 10 + .../io/graphson/_3_2_9/pand-v2d0-no-types.json | 10 + .../io/graphson/_3_2_9/pand-v2d0-partial.json | 25 + .../structure/io/graphson/_3_2_9/path-v1d0.json | 62 ++ .../io/graphson/_3_2_9/path-v2d0-no-types.json | 13 + .../io/graphson/_3_2_9/path-v2d0-partial.json | 34 + .../io/graphson/_3_2_9/period-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/pick-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/pick-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/pop-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/pop-v2d0-partial.json| 4 + .../io/graphson/_3_2_9/por-v2d0-no-types.json | 10 + .../io/graphson/_3_2_9/por-v2d0-partial.json| 31 + .../io/graphson/_3_2_9/property-v1d0.json | 4 + .../graphson/_3_2_9/property-v2d0-no-types.json | 4 +
[28/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1903' into tp33
Merge branch 'TINKERPOP-1903' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/38b85d2f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/38b85d2f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/38b85d2f Branch: refs/heads/TINKERPOP-1869 Commit: 38b85d2f03c3ea0808a086e38ca51f0b5d74410f Parents: 6aa5f2e bad59e5 Author: Stephen MalletteAuthored: Thu Apr 19 12:42:04 2018 -0400 Committer: Stephen Mallette Committed: Thu Apr 19 12:42:04 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 31 ++-- docs/src/upgrade/release-3.3.x.asciidoc | 27 .../jsr223/dsl/credential/CredentialGraph.java | 2 + .../CredentialGraphGremlinPlugin.java | 6 +- .../dsl/credential/CredentialTraversalDsl.java | 74 ++ .../CredentialTraversalSourceDsl.java | 79 ++ .../dsl/credential/CredentialGraphTest.java | 4 + .../credential/CredentialTraversalDslTest.java | 143 +++ 9 files changed, 354 insertions(+), 13 deletions(-) --
[15/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1934' into tp32
Merge branch 'TINKERPOP-1934' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a7c8ea10 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a7c8ea10 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a7c8ea10 Branch: refs/heads/TINKERPOP-1869 Commit: a7c8ea102425e9df5f9f3eca20df333db8cdf936 Parents: 54df6dc f9e0cf5 Author: Stephen MalletteAuthored: Mon Apr 16 07:48:42 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 16 07:48:42 2018 -0400 -- CHANGELOG.asciidoc | 5 + gremlin-console/pom.xml| 1 - gremlin-console/src/main/static/NOTICE | 6 -- gremlin-server/pom.xml | 1 - pom.xml| 5 + 5 files changed, 10 insertions(+), 8 deletions(-) --
[11/50] [abbrv] tinkerpop git commit: Merge branch 'TINKERPOP-1927' into tp33
Merge branch 'TINKERPOP-1927' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a4b7ac44 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a4b7ac44 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a4b7ac44 Branch: refs/heads/TINKERPOP-1869 Commit: a4b7ac44725cc7d1322ed65b5330d11c2e45ac38 Parents: cf6f974 2d6c28a Author: Stephen MalletteAuthored: Thu Apr 12 10:29:51 2018 -0400 Committer: Stephen Mallette Committed: Thu Apr 12 10:29:51 2018 -0400 -- CHANGELOG.asciidoc| 7 +++ .../structure/io/graphson/GraphSONTypeSerializerV3d0.java | 3 ++- .../Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs | 5 + .../Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs| 6 -- 4 files changed, 10 insertions(+), 11 deletions(-) --
[47/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/ffaca891 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ffaca891 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ffaca891 Branch: refs/heads/TINKERPOP-1869 Commit: ffaca8915e3df4952c02c922045a224176e07037 Parents: ead5659 c155818 Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:31 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:31 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffaca891/docs/src/reference/gremlin-variants.asciidoc --
[13/50] [abbrv] tinkerpop git commit: TINKERPOP-1912 Updated signature verification instructions on download page.
TINKERPOP-1912 Updated signature verification instructions on download page. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5f815045 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5f815045 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5f815045 Branch: refs/heads/TINKERPOP-1869 Commit: 5f81504565783d106a934d35b24ef3fac78a7450 Parents: c31aa58 Author: Daniel KuppitzAuthored: Thu Apr 12 11:04:22 2018 -0700 Committer: Daniel Kuppitz Committed: Thu Apr 12 11:04:22 2018 -0700 -- docs/site/home/downloads.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5f815045/docs/site/home/downloads.html -- diff --git a/docs/site/home/downloads.html b/docs/site/home/downloads.html index efe3ac8..f5f0ab3 100644 --- a/docs/site/home/downloads.html +++ b/docs/site/home/downloads.html @@ -491,7 +491,7 @@ limitations under the License. Note that upgrade documentation was only introduced at 3.1.1-incubating which is why there are no links "upgrade" links in versions prior to that one. Verifying Downloads -All downloads have associated PGP and MD5 signatures to help verify a distribution provided by a mirror. To verify a distribution via PGP or GPG first download the +All downloads have associated PGP and SHA1 signatures to help verify a distribution provided by a mirror. To verify a distribution via PGP or GPG first download the https://www.apache.org/dist/tinkerpop/KEYS;>KEYS file (it is important to use the linked file which is from the main distribution directory and not a mirror. Next download the appropriate "asc" signature file for the relevant distribution (again, this file should come from the https://www.apache.org/dist/tinkerpop/;>main distribution directory - note that older releases will have such files in the https://archive.apache.org/dist/tinkerpop/;>archives or if released under Apache @@ -517,7 +517,7 @@ limitations under the License. gpg --verify apache-gremlin-console-x.y.z-bin.zip.asc apache-gremlin-console-x.y.z-bin.zip -Alternatively, consider verifying the MD5 signature on the files. An MD5 signature consists of 32 hex characters, and a SHA1 signature consists of 40 hex characters. +Alternatively, consider verifying the SHA1 signature on the files. An SHA1 signature consists of 40 hex characters. Ensure that the generated signature string matches the signature string published in the files above.
[36/50] [abbrv] tinkerpop git commit: Fix typos in GraphManager and DefaultGraphManager javadoc
Fix typos in GraphManager and DefaultGraphManager javadoc Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/268423d2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/268423d2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/268423d2 Branch: refs/heads/TINKERPOP-1869 Commit: 268423d2d16397ad749082041ea0e17075a3093d Parents: 682f298 Author: Justin Chu <15710241+justinch...@users.noreply.github.com> Authored: Fri Apr 20 22:47:31 2018 -0400 Committer: Justin Chu <15710241+justinch...@users.noreply.github.com> Committed: Fri Apr 20 22:52:30 2018 -0400 -- .../java/org/apache/tinkerpop/gremlin/server/GraphManager.java | 4 ++-- .../tinkerpop/gremlin/server/util/DefaultGraphManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/268423d2/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java index 8e3198f..bcb4a8e 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java @@ -69,8 +69,8 @@ public interface GraphManager { * * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the * {@link TraversalSource} itself - * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and - * {@link #getTraversalSource(String)} (String)} - note that the expectation is this method return an immutable + * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and + * {@link #getTraversalSource(String)} - note that the expectation is this method return an immutable * {@code Map} which was not the expectation prior to 3.2.5. */ @Deprecated http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/268423d2/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java index 5e4a355..9b5668f 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java @@ -96,8 +96,8 @@ public final class DefaultGraphManager implements GraphManager { * * @return a {@code Map} where the key is the name of the {@link TraversalSource} and the value is the * {@link TraversalSource} itself - * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and - * {@link #getTraversalSource(String)} (String)} + * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and + * {@link #getTraversalSource(String)} */ @Deprecated public final MapgetTraversalSources() {
[09/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/cf6f9746 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cf6f9746 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cf6f9746 Branch: refs/heads/TINKERPOP-1869 Commit: cf6f9746e3427f6c9cbc5c48d1153b2b523f5880 Parents: 0c9afb6 35bf95a Author: Stephen MalletteAuthored: Wed Apr 11 09:14:00 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 09:14:00 2018 -0400 -- docs/src/recipes/collections.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[01/50] [abbrv] tinkerpop git commit: TINKERPOP-1927 Coerced BulkSet to g:List in GraphSON 3.0 [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1869 3e83344d2 -> 374b51a3f (forced update) TINKERPOP-1927 Coerced BulkSet to g:List in GraphSON 3.0 Since GLVs don't have BulkSet infrastructure and the need to include it doesn't seem high the most direct fix here is to coerce to g:List as the behavior for BulkSet iteration is basically that same as a List. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d6c28a4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d6c28a4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d6c28a4 Branch: refs/heads/TINKERPOP-1869 Commit: 2d6c28a4781786238866bbc942d7706e16ec628e Parents: 46be135 Author: Stephen MalletteAuthored: Thu Apr 5 08:59:56 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 9 14:06:00 2018 -0400 -- CHANGELOG.asciidoc| 7 +++ .../structure/io/graphson/GraphSONTypeSerializerV3d0.java | 3 ++- .../Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs | 5 + .../Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs| 6 -- 4 files changed, 10 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d6c28a4/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index d07cea8..ad9085a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -20,6 +20,13 @@ limitations under the License. image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/gremlin-mozart.png[width=185] +[[release-3-3-3]] +=== TinkerPop 3.3.3 (Release Date: NOT OFFICIALLY RELEASED YET) + +This release also includes changes from < >. + +* Coerced `BulkSet` to `g:List` in GraphSON 3.0. + [[release-3-3-2]] === TinkerPop 3.3.2 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d6c28a4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java index 3bdbc71..2cd57dc 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializerV3d0.java @@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; import org.apache.tinkerpop.gremlin.process.traversal.Scope; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; import org.apache.tinkerpop.gremlin.process.traversal.util.Metrics; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics; @@ -124,7 +125,7 @@ public class GraphSONTypeSerializerV3d0 extends AbstractGraphSONTypeSerializer { mapped = Tree.class; else mapped = Map.class; -} else if (List.class.isAssignableFrom(c)) +} else if (List.class.isAssignableFrom(c) || BulkSet.class.isAssignableFrom(c)) // coerce BulkSet to List as their behavior on iteration is identical mapped = List.class; else if (Set.class.isAssignableFrom(c)) mapped = Set.class; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d6c28a4/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs index 68d10fe..6d38ccc 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs @@ -38,10 +38,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin public class GherkinTestRunner { private static readonly IDictionary IgnoredScenarios = -new Dictionary -{ - {"g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX",
[30/50] [abbrv] tinkerpop git commit: Shutdown server in test to try to ensure log flush for assertion
Shutdown server in test to try to ensure log flush for assertion Tests that check logs for assertions tend to randomly fail despite a number of attempt to try to harden them. In this attempt I shutdown the server prior to log assertion in the hopes that it will flush everything through and prevent failures. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4705c041 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4705c041 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4705c041 Branch: refs/heads/TINKERPOP-1869 Commit: 4705c0416d522cce4d8c6ec498215f7f446fee4d Parents: 1daf3f1 Author: Stephen MalletteAuthored: Fri Apr 20 10:56:34 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 10:56:34 2018 -0400 -- .../tinkerpop/gremlin/server/GremlinServerIntegrateTest.java | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4705c041/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 6454ad5..a1689e9 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -327,9 +327,12 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration // there record Thread.sleep(3000); -assertThat(recordingAppender.logContainsAny(".*Checking channel - sending ping to client after idle period of .*$"), is(true)); - client.close(); + +// stop the server to be sure that logs flush +stopServer(); + +assertThat(recordingAppender.logContainsAny(".*Checking channel - sending ping to client after idle period of .*$"), is(true)); } @Test
[38/50] [abbrv] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo new file mode 100644 index 000..ba94b5d Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo new file mode 100644 index 000..ba94b5d Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo new file mode 100644 index 000..edf8dd4 Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo new file mode 100644 index 000..edf8dd4 Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo new file mode 100644 index 000..71bd63e --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo @@ -0,0 +1 @@ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo new file mode 100644 index 000..71bd63e --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo @@ -0,0 +1 @@ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo new file mode 100644 index 000..718882c Binary files
[19/50] [abbrv] tinkerpop git commit: Removed a hack that was required in 3.2.x in JavaTranslator
Removed a hack that was required in 3.2.x in JavaTranslator The method in question that needed that hack for things to cache properly is no longer present in 3.3.x so that little bit of code is no longer needed. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/358f99b1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/358f99b1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/358f99b1 Branch: refs/heads/TINKERPOP-1869 Commit: 358f99b186f3fceb856d42b591c281cac2ec5df3 Parents: d63638b Author: Stephen MalletteAuthored: Tue Apr 17 15:06:31 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 17 15:06:31 2018 -0400 -- .../org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java| 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/358f99b1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java index 0664048..7480974 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java @@ -256,10 +256,8 @@ public final class JavaTranslator> methodCache) { if (methodCache.isEmpty()) { for (final Method method : delegate.getClass().getMethods()) { -if (!(method.getName().equals("addV") && method.getParameterCount() == 1 && method.getParameters()[0].getType().equals(Object[].class))) { // hack cause its hard to tell Object[] vs. String :| -final List list = methodCache.computeIfAbsent(method.getName(), k -> new ArrayList<>()); -list.add(method); -} +final List list = methodCache.computeIfAbsent(method.getName(), k -> new ArrayList<>()); +list.add(method); } GLOBAL_METHOD_CACHE.put(delegate.getClass(), methodCache); }
[40/50] [abbrv] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json new file mode 100644 index 000..03f45cd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetDateTime", + "@value" : "2007-12-03T10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json new file mode 100644 index 000..03f45cd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetDateTime", + "@value" : "2007-12-03T10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json new file mode 100644 index 000..b124953 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetTime", + "@value" : "10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json new file mode 100644 index 000..b124953 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetTime", + "@value" : "10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json new file mode 100644 index 000..14c1400 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "g:Operator", + "@value" : "sum" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json new file mode 100644 index 000..14c1400 --- /dev/null +++
[37/50] [abbrv] tinkerpop git commit: Improve JavaScript Gremlin documentation
Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/TINKERPOP-1869 Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics; g.V().repeat(__.out()).times(2).values("name").fold().toList();
[05/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/0f085146 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0f085146 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0f085146 Branch: refs/heads/TINKERPOP-1869 Commit: 0f085146135b109a70821da699ca502c52fb375c Parents: aa40dfa da05f94 Author: Stephen MalletteAuthored: Wed Apr 11 08:57:02 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 08:57:02 2018 -0400 -- docs/src/recipes/collections.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --
[42/50] [abbrv] tinkerpop git commit: Added io test data for 3.2.9. CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json new file mode 100644 index 000..db030dd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json @@ -0,0 +1,276 @@ +{ + "1" : { +"key" : { + "id" : 1, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 0, + "value" : "marko" +} ], +"location" : [ { + "id" : 6, + "value" : "san diego", + "properties" : { +"startTime" : 1997, +"endTime" : 2001 + } +}, { + "id" : 7, + "value" : "santa cruz", + "properties" : { +"startTime" : 2001, +"endTime" : 2004 + } +}, { + "id" : 8, + "value" : "brussels", + "properties" : { +"startTime" : 2004, +"endTime" : 2005 + } +}, { + "id" : 9, + "value" : "santa fe", + "properties" : { +"startTime" : 2005 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +}, +"value" : { + "11" : { +"key" : { + "id" : 11, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 5, + "value" : "tinkergraph" +} ] + } +}, +"value" : { } + } +} + } +} + }, + "7" : { +"key" : { + "id" : 7, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 1, + "value" : "stephen" +} ], +"location" : [ { + "id" : 10, + "value" : "centreville", + "properties" : { +"startTime" : 1990, +"endTime" : 2000 + } +}, { + "id" : 11, + "value" : "dulles", + "properties" : { +"startTime" : 2000, +"endTime" : 2006 + } +}, { + "id" : 12, + "value" : "purcellville", + "properties" : { +"startTime" : 2006 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +}, +"value" : { + "11" : { +"key" : { + "id" : 11, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 5, + "value" : "tinkergraph" +} ] + } +}, +"value" : { } + } +} + } +} + }, + "8" : { +"key" : { + "id" : 8, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 2, + "value" : "matthias" +} ], +"location" : [ { + "id" : 13, + "value" : "bremen", + "properties" : { +"startTime" : 2004, +"endTime" : 2007 + } +}, { + "id" : 14, + "value" : "baltimore", + "properties" : { +"startTime" : 2007, +"endTime" : 2011 + } +}, { + "id" : 15, + "value" : "oakland", + "properties" : { +"startTime" : 2011, +"endTime" : 2014 + } +}, { + "id" : 16, + "value" : "seattle", + "properties" : { +"startTime" : 2014 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +
[18/50] [abbrv] tinkerpop git commit: TINKERPOP-1936 Improved performance of Bytecode deserialization.
TINKERPOP-1936 Improved performance of Bytecode deserialization. GraphSON deserialization of Bytecode was using generic List deserialization which became especially costly for Jackson in 2.5.x because of changes that synchronized access to the deserialization cache and because the collection deserialization were no longer cacheable when type deserialization was in play. This change removed the use of generic type lists in deserialization and more directly handled the parsing of the lists thus bypassing the collection deserializer for this specific case. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e68df44c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e68df44c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e68df44c Branch: refs/heads/TINKERPOP-1869 Commit: e68df44caaafd9f4037da8e03be660a4124555eb Parents: a7c8ea1 Author: Stephen MalletteAuthored: Thu Apr 12 10:25:20 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 16 13:47:35 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e68df44c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 0f3a71a..51c9f68 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET) * Bumped to httpclient 4.5.5. +* Improved performance of GraphSON deserialization of `Bytecode`. [[release-3-2-8]] === TinkerPop 3.2.8 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e68df44c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java index a696280..040fd1d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java @@ -248,8 +248,6 @@ final class TraversalSerializersV2d0 { // final static class BytecodeJacksonDeserializer extends StdDeserializer { -private static final JavaType listJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object.class); -private static final JavaType listListJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, listJavaType); public BytecodeJacksonDeserializer() { super(Bytecode.class); @@ -260,17 +258,30 @@ final class TraversalSerializersV2d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the start array +jsonParser.nextToken(); + +
[07/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/0c9afb61 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0c9afb61 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0c9afb61 Branch: refs/heads/TINKERPOP-1869 Commit: 0c9afb614bd79bc48d02cf63f94e8942c8a577e1 Parents: 0f08514 e1a69fd Author: Stephen MalletteAuthored: Wed Apr 11 09:05:46 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 09:05:46 2018 -0400 -- --
[20/50] [abbrv] tinkerpop git commit: Fixed grammar mistakes in javadocs for DriverRemoteTraversal CTR
Fixed grammar mistakes in javadocs for DriverRemoteTraversal CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/430c97d1 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/430c97d1 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/430c97d1 Branch: refs/heads/TINKERPOP-1869 Commit: 430c97d14ecc173eaa0e3d38fe9f78623bc005d4 Parents: a7c8ea1 Author: Stephen MalletteAuthored: Wed Apr 18 17:12:43 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 18 17:12:43 2018 -0400 -- .../tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/430c97d1/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java -- diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java index d3f290c..d991f21 100644 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java @@ -40,9 +40,9 @@ import java.util.function.Supplier; /** * A {@link AbstractRemoteTraversal} implementation for the Gremlin Driver. This {@link Traversal} implementation is - * typically iterated from with {@link RemoteStep} where it the {@link #nextTraverser()} method is called. While - * this class provides implementations for both {@link #next()} and {@link #hasNext()} that unroll "bulked" results, - * those methods are not called directly from with TinkerPop remoting. + * typically iterated from {@link RemoteStep} where the {@link #nextTraverser()} method is called. While this class + * provides implementations for both {@link #next()} and {@link #hasNext()} that unroll "bulked" results, those methods + * are not called directly from with TinkerPop remoting. * * @author Stephen Mallette (http://stephen.genoprime.com) */
[21/50] [abbrv] tinkerpop git commit: Move validation into set() method to avoid double loop.
Move validation into set() method to avoid double loop. Parameters tends to be a hotspot in traversal construction. This doesn't amount to much in terms of performance overall for most traversals, but since the validation code isn't being used anywhere else there's not much value in having it isolated anyway. Better to just kill the double loop. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4dcee1ad Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4dcee1ad Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4dcee1ad Branch: refs/heads/TINKERPOP-1869 Commit: 4dcee1ad22bfe5c7597feebbbcb74577e5f8d7ca Parents: 430c97d Author: Stephen MalletteAuthored: Wed Apr 18 17:43:10 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 18 17:43:10 2018 -0400 -- .../process/traversal/step/util/Parameters.java | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4dcee1ad/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java index 5cb6001..7fae30a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java @@ -171,8 +171,13 @@ public final class Parameters implements Cloneable, Serializable { * Set parameters given key/value pairs. */ public void set(final TraversalParent parent, final Object... keyValues) { -Parameters.legalPropertyKeyValueArray(keyValues); +if (keyValues.length % 2 != 0) +throw Element.Exceptions.providedKeyValuesMustBeAMultipleOfTwo(); + for (int i = 0; i < keyValues.length; i = i + 2) { +if (!(keyValues[i] instanceof String) && !(keyValues[i] instanceof T) && !(keyValues[i] instanceof Traversal)) +throw new IllegalArgumentException("The provided key/value array must have a String, T, or Traversal on even array indices"); + if (keyValues[i + 1] != null) { // track the list of traversals that are present so that elsewhere in Parameters there is no need // to iterate all values to not find any. also grab available labels in traversal values @@ -253,15 +258,6 @@ public final class Parameters implements Cloneable, Serializable { return this.parameters.toString(); } -private static void legalPropertyKeyValueArray(final Object... propertyKeyValues) throws IllegalArgumentException { -if (propertyKeyValues.length % 2 != 0) -throw Element.Exceptions.providedKeyValuesMustBeAMultipleOfTwo(); -for (int i = 0; i < propertyKeyValues.length; i = i + 2) { -if (!(propertyKeyValues[i] instanceof String) && !(propertyKeyValues[i] instanceof T) && !(propertyKeyValues[i] instanceof Traversal)) -throw new IllegalArgumentException("The provided key/value array must have a String, T, or Traversal on even array indices"); -} -} - private void addTraversal(final Traversal.Admin t) { this.traversals.add(t); for (final Object ss : t.getSteps()) {
[03/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/aa40dfa6 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/aa40dfa6 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/aa40dfa6 Branch: refs/heads/TINKERPOP-1869 Commit: aa40dfa6e4240917e67077e315833ecedfde7e0b Parents: 46be135 42bacaf Author: Daniel KuppitzAuthored: Mon Apr 9 11:32:52 2018 -0700 Committer: Daniel Kuppitz Committed: Mon Apr 9 11:32:52 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa40dfa6/docs/src/reference/the-traversal.asciidoc --
[16/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/d63638b8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d63638b8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d63638b8 Branch: refs/heads/TINKERPOP-1869 Commit: d63638b83f8cfeb4b07410c741ea4f3918e84575 Parents: 01c8954 a7c8ea1 Author: Stephen MalletteAuthored: Mon Apr 16 07:49:03 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 16 07:49:03 2018 -0400 -- CHANGELOG.asciidoc | 5 + gremlin-console/pom.xml| 1 - gremlin-console/src/main/static/NOTICE | 6 -- gremlin-server/pom.xml | 1 - pom.xml| 5 + 5 files changed, 10 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d63638b8/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d63638b8/gremlin-console/pom.xml -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d63638b8/gremlin-console/src/main/static/NOTICE -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d63638b8/gremlin-server/pom.xml -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d63638b8/pom.xml --
[10/50] [abbrv] tinkerpop git commit: TINKERPOP-1912 Removed MD5 checksums from release
TINKERPOP-1912 Removed MD5 checksums from release Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/54df6dcb Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/54df6dcb Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/54df6dcb Branch: refs/heads/TINKERPOP-1869 Commit: 54df6dcbd081ec685723cdfc508af5513fb66dd0 Parents: 35bf95a Author: Daniel KuppitzAuthored: Tue Apr 10 13:31:47 2018 -0700 Committer: Daniel Kuppitz Committed: Wed Apr 11 09:27:19 2018 -0700 -- bin/validate-distribution.sh| 3 ++- docs/src/dev/developer/release.asciidoc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54df6dcb/bin/validate-distribution.sh -- diff --git a/bin/validate-distribution.sh b/bin/validate-distribution.sh index 0121a1a..b071ea0 100755 --- a/bin/validate-distribution.sh +++ b/bin/validate-distribution.sh @@ -83,10 +83,11 @@ fi echo -n "* downloading ${COMPONENT} (${ZIP_FILENAME})... " curl -Lsf ${URL} -o ${ZIP_FILENAME} || { echo "Failed to download ${COMPONENT}" ; exit 1; } -for ext in "asc" "md5" "sha1" +for ext in "asc" "sha1" do curl -Lsf ${URL}.${ext} -o ${ZIP_FILENAME}.${ext} || { echo "Failed to download ${COMPONENT} (${ext})" ; exit 1 ; } done +curl -Lsf ${URL}.md5 -o ${ZIP_FILENAME}.md5 && { echo "MD5 checksums should not be released (${ZIP_FILENAME}.md5)" ; exit 1 ; } echo "OK" # validate zip file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/54df6dcb/docs/src/dev/developer/release.asciidoc -- diff --git a/docs/src/dev/developer/release.asciidoc b/docs/src/dev/developer/release.asciidoc index c7c5bb7..608bb31 100644 --- a/docs/src/dev/developer/release.asciidoc +++ b/docs/src/dev/developer/release.asciidoc @@ -209,6 +209,7 @@ for generating javadoc and without that the binary distributions won't contain t .. `cp ~/.m2/repository/org/apache/tinkerpop/gremlin-console/xx.yy.zz/gremlin-console-xx.yy.zz-distribution.zip* dev/xx.yy.zz` .. `cp ~/.m2/repository/org/apache/tinkerpop/gremlin-server/xx.yy.zz/gremlin-server-xx.yy.zz-distribution.zip* dev/xx.yy.zz` .. `cp ~/.m2/repository/org/apache/tinkerpop/tinkerpop/xx.yy.zz/tinkerpop-xx.yy.zz-source-release.zip* dev/xx.yy.zz` +.. `rm -f dev/*.md5 .. `cd dev/xx.yy.zz` .. pass:[ls * | xargs -n1 -I {} echo "mv apache-tinkerpop-{} {}" | sed -e 's/distribution/bin/' -e 's/source-release/src/' -e 's/tinkerpop-tinkerpop/tinkerpop/' -e s'/^\(.*\) \(.*\) \(.*\)$/\1 \3 \2/' | /bin/bash] .. `cd ..; svn add xx.yy.zz/; svn ci -m "TinkerPop xx.yy.zz release"`
[49/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/8005cb3e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8005cb3e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8005cb3e Branch: refs/heads/TINKERPOP-1869 Commit: 8005cb3eecffe2ff64e06e669784564641c3e64d Parents: ffaca89 8462f85 Author: Stephen MalletteAuthored: Tue Apr 24 09:20:51 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:20:51 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8005cb3e/gremlin-python/src/main/jython/radish/feature_steps.py --
[34/50] [abbrv] tinkerpop git commit: TINKERPOP-1936 Improved performance of Bytecode deserialization.
TINKERPOP-1936 Improved performance of Bytecode deserialization. GraphSON deserialization of Bytecode was using generic List deserialization which became especially costly for Jackson in 2.5.x because of changes that synchronized access to the deserialization cache and because the collection deserialization were no longer cacheable when type deserialization was in play. This change removed the use of generic type lists in deserialization and more directly handled the parsing of the lists thus bypassing the collection deserializer for this specific case. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/682f298c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/682f298c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/682f298c Branch: refs/heads/TINKERPOP-1869 Commit: 682f298cc82d66fd7040cb29a7d3b769be5e2794 Parents: 2591302 Author: Stephen MalletteAuthored: Thu Apr 12 10:25:20 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:29:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682f298c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 0f3a71a..51c9f68 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET) * Bumped to httpclient 4.5.5. +* Improved performance of GraphSON deserialization of `Bytecode`. [[release-3-2-8]] === TinkerPop 3.2.8 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682f298c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java index a696280..040fd1d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java @@ -248,8 +248,6 @@ final class TraversalSerializersV2d0 { // final static class BytecodeJacksonDeserializer extends StdDeserializer { -private static final JavaType listJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object.class); -private static final JavaType listListJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, listJavaType); public BytecodeJacksonDeserializer() { super(Bytecode.class); @@ -260,17 +258,30 @@ final class TraversalSerializersV2d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the start array +jsonParser.nextToken(); + +
[48/50] [abbrv] tinkerpop git commit: Added Pop.all to python gherkin test support
Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/TINKERPOP-1869 Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
[17/50] [abbrv] tinkerpop git commit: TINKERPOP-1903 Migrated Credential DSL to annotation processor
TINKERPOP-1903 Migrated Credential DSL to annotation processor The old CredentialGraph approach to the Credential DSL has been deprecated in favor of the preferred method for DSL development which was published long after the original DSL was developed. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bad59e50 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bad59e50 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bad59e50 Branch: refs/heads/TINKERPOP-1869 Commit: bad59e50256604939394ec1bace299587db24422 Parents: d63638b Author: Stephen MalletteAuthored: Thu Apr 5 11:51:49 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 16 08:26:11 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 31 ++-- docs/src/upgrade/release-3.3.x.asciidoc | 27 .../jsr223/dsl/credential/CredentialGraph.java | 2 + .../CredentialGraphGremlinPlugin.java | 6 +- .../dsl/credential/CredentialTraversalDsl.java | 74 ++ .../CredentialTraversalSourceDsl.java | 79 ++ .../dsl/credential/CredentialGraphTest.java | 4 + .../credential/CredentialTraversalDslTest.java | 143 +++ 9 files changed, 354 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bad59e50/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index a3512ec..45ac72c 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 < >. * Coerced `BulkSet` to `g:List` in GraphSON 3.0. +* Deprecated `CredentialsGraph` DSL in favor of `CredentialsTraversalDsl` which uses the recommended method for Gremlin DSL development. [[release-3-3-2]] === TinkerPop 3.3.2 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bad59e50/docs/src/reference/gremlin-applications.asciidoc -- diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index 53a1642..f87499d 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -1351,9 +1351,9 @@ the `Graph`, consider specifying a unique constraint as well. To aid with the management of a credentials graph, Gremlin Server provides a Gremlin Console plugin which can be used to add and remove users so as to ensure that the schema is adhered to, thus ensuring compatibility with Gremlin - Server. In addition, as it is a plugin, it works naturally in the Gremlin Console as an extension of its - capabilities (though one could use it programmatically, if desired). This plugin is distributed with the Gremlin - Console so it does not have to be "installed". It does however need to be activated: +Server. In addition, as it is a plugin, it works naturally in the Gremlin Console as an extension of its +capabilities (though one could use it programmatically, if desired). This plugin is distributed with the Gremlin +Console so it does not have to be "installed". It does however need to be activated: [source,groovy] gremlin> :plugin use tinkerpop.credentials @@ -1365,15 +1365,22 @@ Please see the example usage as follows: graph = TinkerGraph.open() graph.createIndex("username",Vertex.class) -credentials = credentials(graph) -credentials.createUser("stephen","password") -credentials.createUser("daniel","better-password") -credentials.createUser("marko","rainbow-dash") -credentials.findUser("marko").properties() -credentials.countUsers() -credentials.removeUser("daniel") -credentials.countUsers() - +credentials = graph.traversal(CredentialTraversalSource.class) +credentials.user("stephen","password") +credentials.user("daniel","better-password") +credentials.user("marko","rainbow-dash") +credentials.users("marko").valueMap() +credentials.users().count() +credentials.users("daniel").drop() +credentials.users().count() + + +NOTE: The Credentials DSL is built using TinkerPop's DSL Annotation Processor described < >. + +IMPORTANT: In the above example, an empty in-memory TinkerGraph was used for demonstrating the API of the DSL. +Obviously, this data will not be retained and usable with Gremlin Server. It would be important to configure +TinkerGraph to persist that data or to manually persist it (e.g. write the graph data to Gryo) once changes are +complete.
[45/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/ead56590 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ead56590 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ead56590 Branch: refs/heads/TINKERPOP-1869 Commit: ead56590a6374d5757b53a5412bef47b87c1e4b2 Parents: 9a58689 268423d Author: Stephen MalletteAuthored: Mon Apr 23 13:50:29 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 23 13:50:29 2018 -0400 -- .../java/org/apache/tinkerpop/gremlin/server/GraphManager.java | 4 ++-- .../tinkerpop/gremlin/server/util/DefaultGraphManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --
[25/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/cd1844ca Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cd1844ca Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cd1844ca Branch: refs/heads/TINKERPOP-1869 Commit: cd1844cad93778e68f8f3a29491ffe896f2ba407 Parents: 028aba4 b99c56a Author: Stephen MalletteAuthored: Thu Apr 19 07:16:19 2018 -0400 Committer: Stephen Mallette Committed: Thu Apr 19 07:16:19 2018 -0400 -- docs/src/reference/gremlin-variants.asciidoc | 8 docs/static/images/gremlin-js.png| Bin 0 -> 78981 bytes 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cd1844ca/docs/src/reference/gremlin-variants.asciidoc --
[08/50] [abbrv] tinkerpop git commit: Fixed a spelling mistake in collections recipe CTR
Fixed a spelling mistake in collections recipe CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/35bf95ad Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/35bf95ad Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/35bf95ad Branch: refs/heads/TINKERPOP-1869 Commit: 35bf95ad31067a7a7203f21a310dd9d26e371f59 Parents: e1a69fd Author: Stephen MalletteAuthored: Wed Apr 11 09:13:43 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 09:13:43 2018 -0400 -- docs/src/recipes/collections.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/35bf95ad/docs/src/recipes/collections.asciidoc -- diff --git a/docs/src/recipes/collections.asciidoc b/docs/src/recipes/collections.asciidoc index f44040a..d027376 100644 --- a/docs/src/recipes/collections.asciidoc +++ b/docs/src/recipes/collections.asciidoc @@ -324,7 +324,7 @@ g.V(). by(values)) -The addition steps above `unfold()` the `Map` to key-value entries and filter the values for "n/a" and remove them +The additional steps above `unfold()` the `Map` to key-value entries and filter the values for "n/a" and remove them prior to reconstructing the `Map` with the method shown earlier. To go a step further, apply the pattern presented earlier to flatten `List` values within a `Map`:
[04/50] [abbrv] tinkerpop git commit: Fixed a grammar mistake in collections recipe CTR
Fixed a grammar mistake in collections recipe CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/da05f940 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/da05f940 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/da05f940 Branch: refs/heads/TINKERPOP-1869 Commit: da05f9401100bb985c0697d06cb1a0487b14275f Parents: df7870a Author: Stephen MalletteAuthored: Wed Apr 11 08:56:22 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 08:56:22 2018 -0400 -- docs/src/recipes/collections.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da05f940/docs/src/recipes/collections.asciidoc -- diff --git a/docs/src/recipes/collections.asciidoc b/docs/src/recipes/collections.asciidoc index 61fee99..f44040a 100644 --- a/docs/src/recipes/collections.asciidoc +++ b/docs/src/recipes/collections.asciidoc @@ -64,9 +64,9 @@ g.V().fold().unfold().values('name') g.V().store('a').cap('a').unfold().values('name') -The above examples show that `unfold()` works quite well when you want don't want to preserve the `List` structure of -the traverser as it just flattens `List` traversers to the traversal stream. The above examples only have one `List` -as a result, but consider what happens when there is more than one: +The above examples show that `unfold()` works quite well when you don't want to preserve the `List` structure of the +traverser as it just flattens `List` traversers to the traversal stream. The above examples only have one `List` as a +result, but consider what happens when there is more than one: [gremlin-groovy,modern]
[02/50] [abbrv] tinkerpop git commit: CTR: fixed minor typos in docs
CTR: fixed minor typos in docs Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/42bacafb Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/42bacafb Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/42bacafb Branch: refs/heads/TINKERPOP-1869 Commit: 42bacafbf4189cfb89ad53f1b38fee9ea21dd64e Parents: df7870a Author: Daniel KuppitzAuthored: Mon Apr 9 11:32:38 2018 -0700 Committer: Daniel Kuppitz Committed: Mon Apr 9 11:32:38 2018 -0700 -- docs/src/reference/the-traversal.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/42bacafb/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 69bc8a3..86fb324 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -2342,7 +2342,7 @@ g.V().out().as('a').out().as('b').out().as('c'). by('name') -By using the `from()` and `to()` modulators traversers can ensure that only certain sections of the path are are acyclic. +By using the `from()` and `to()` modulators traversers can ensure that only certain sections of the path are acyclic. [gremlin-groovy] @@ -3043,7 +3043,7 @@ of the Gremlin traversal machine's compiler. There are 5 categories of strategie * There is an application-level feature that can be embedded into the traversal logic (*decoration*). * There is a more efficient way to express the traversal at the TinkerPop3 level (*optimization*). * There is a more efficient way to express the traversal at the graph system/language/driver level (*provider optimization*). - * There are are some final adjustments/cleanups/analyses required before executing the traversal (*finalization*). + * There are some final adjustments/cleanups/analyses required before executing the traversal (*finalization*). * There are certain traversals that are not legal for the application or traversal engine (*verification*). NOTE: The < >-step shows the user how each registered strategy mutates the traversal.
[06/50] [abbrv] tinkerpop git commit: Fixed a grammar mistake in collections recipe CTR
Fixed a grammar mistake in collections recipe CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e1a69fd8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e1a69fd8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e1a69fd8 Branch: refs/heads/TINKERPOP-1869 Commit: e1a69fd8075f02ae1f22c4195edd956bf988445a Parents: 42bacaf Author: Stephen MalletteAuthored: Wed Apr 11 08:56:22 2018 -0400 Committer: Stephen Mallette Committed: Wed Apr 11 09:05:33 2018 -0400 -- docs/src/recipes/collections.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1a69fd8/docs/src/recipes/collections.asciidoc -- diff --git a/docs/src/recipes/collections.asciidoc b/docs/src/recipes/collections.asciidoc index 61fee99..f44040a 100644 --- a/docs/src/recipes/collections.asciidoc +++ b/docs/src/recipes/collections.asciidoc @@ -64,9 +64,9 @@ g.V().fold().unfold().values('name') g.V().store('a').cap('a').unfold().values('name') -The above examples show that `unfold()` works quite well when you want don't want to preserve the `List` structure of -the traverser as it just flattens `List` traversers to the traversal stream. The above examples only have one `List` -as a result, but consider what happens when there is more than one: +The above examples show that `unfold()` works quite well when you don't want to preserve the `List` structure of the +traverser as it just flattens `List` traversers to the traversal stream. The above examples only have one `List` as a +result, but consider what happens when there is more than one: [gremlin-groovy,modern]
[5/5] tinkerpop git commit: TINKERPOP-1950 Cached global strategy lookups during traversal construction
TINKERPOP-1950 Cached global strategy lookups during traversal construction This change leads to a 1.5x to 2x speed improvement in traversal construction. It is especially effective when processing traversals that have many child traversals within them as this method is called for not only the parent traversal but all the children as well. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4fa21313 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4fa21313 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4fa21313 Branch: refs/heads/TINKERPOP-1950 Commit: 4fa21313bd4647015072b59ec3ba2d7bfb5c665d Parents: 8462f85 Author: Stephen MalletteAuthored: Fri Apr 20 16:18:13 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 18:50:01 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../process/traversal/TraversalStrategies.java | 29 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4fa21313/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 51c9f68..ea7473b 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Bumped to httpclient 4.5.5. * Improved performance of GraphSON deserialization of `Bytecode`. +* Improved performance of traversal construction. [[release-3-2-8]] === TinkerPop 3.2.8 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4fa21313/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java index c7ee5bf..7ca5b61 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java @@ -63,6 +63,8 @@ import java.util.stream.Collectors; */ public interface TraversalStrategies extends Serializable, Cloneable { +static Set LOADED = new HashSet<>(); + static List STRATEGY_CATEGORIES = Collections.unmodifiableList(Arrays.asList(TraversalStrategy.DecorationStrategy.class, TraversalStrategy.OptimizationStrategy.class, TraversalStrategy.ProviderOptimizationStrategy.class, TraversalStrategy.FinalizationStrategy.class, TraversalStrategy.VerificationStrategy.class)); /** @@ -244,20 +246,31 @@ public interface TraversalStrategies extends Serializable, Cloneable { public static TraversalStrategies getStrategies(final Class graphOrGraphComputerClass) { try { // be sure to load the class so that its static{} traversal strategy registration component is loaded. -// this is more important for GraphComputer classes as they are typically not instantiated prior to strategy usage like Graph classes. -final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ? +// this is more important for GraphComputer classes as they are typically not instantiated prior to +// strategy usage like Graph classes. +if (!LOADED.contains(graphOrGraphComputerClass)) { +final String graphComputerClassName = null != graphOrGraphComputerClass.getDeclaringClass() ? graphOrGraphComputerClass.getCanonicalName().replace("." + graphOrGraphComputerClass.getSimpleName(), "$" + graphOrGraphComputerClass.getSimpleName()) : graphOrGraphComputerClass.getCanonicalName(); -Class.forName(graphComputerClassName); +Class.forName(graphComputerClassName); + +// keep track of stuff we already loaded once - stuff in this if/statement isn't cheap and this +// method gets called a lot, basically every time a new traversal gets spun up (that includes +// child traversals. +LOADED.add(graphOrGraphComputerClass); +} } catch (final ClassNotFoundException e) { throw new IllegalStateException(e.getMessage(), e); } -if (Graph.class.isAssignableFrom(graphOrGraphComputerClass)) { -final TraversalStrategies
[4/5] tinkerpop git commit: Added Pop.all to python gherkin test support
Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/TINKERPOP-1950 Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
[2/5] tinkerpop git commit: Improve JavaScript Gremlin documentation
Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/TINKERPOP-1950 Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics; g.V().repeat(__.out()).times(2).values("name").fold().toList();
[3/5] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/TINKERPOP-1950 Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[16/24] tinkerpop git commit: Added io test data for 3.2.9. CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/scope-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/scope-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/scope-v2d0-partial.json new file mode 100644 index 000..4a74af0 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/scope-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "g:Scope", + "@value" : "local" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v1d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v1d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v1d0.json new file mode 100644 index 000..e2cbb13 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v1d0.json @@ -0,0 +1,8 @@ +{ + "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", + "op" : "close", + "processor" : "session", + "args" : { +"session" : "41d2e28a-20a4-4ab0-b379-d810dede3786" + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-no-types.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-no-types.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-no-types.json new file mode 100644 index 000..e2cbb13 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-no-types.json @@ -0,0 +1,8 @@ +{ + "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", + "op" : "close", + "processor" : "session", + "args" : { +"session" : "41d2e28a-20a4-4ab0-b379-d810dede3786" + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-partial.json new file mode 100644 index 000..cc4386b --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessionclose-v2d0-partial.json @@ -0,0 +1,11 @@ +{ + "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", + "op" : "close", + "processor" : "session", + "args" : { +"session" : { + "@type" : "g:UUID", + "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786" +} + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessioneval-v1d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessioneval-v1d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessioneval-v1d0.json new file mode 100644 index 000..ffedd7d --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/sessioneval-v1d0.json @@ -0,0 +1,13 @@ +{ + "requestId" : "cb682578-9d92-4499-9ebc-5c6aa73c5397", + "op" : "eval", + "processor" : "session", + "args" : { +"gremlin" : "g.V(x)", +"language" : "gremlin-groovy", +"session" : "41d2e28a-20a4-4ab0-b379-d810dede3786", +"bindings" : { + "x" : 1 +} + } +} \ No newline at end of file
[12/24] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json new file mode 100644 index 000..24e95ed --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/tinkergraph-v2d0-partial.json @@ -0,0 +1,829 @@ +{ + "@type" : "tinker:graph", + "@value" : { +"vertices" : [ { + "@type" : "g:Vertex", + "@value" : { +"id" : { + "@type" : "g:Int32", + "@value" : 1 +}, +"label" : "person", +"properties" : { + "name" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 0 + }, + "value" : "marko", + "label" : "name" +} + } ], + "location" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 6 + }, + "value" : "san diego", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 1997 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2001 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 7 + }, + "value" : "santa cruz", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2001 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2004 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 8 + }, + "value" : "brussels", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2004 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2005 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 9 + }, + "value" : "santa fe", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 2005 +} + } +} + } ] +} + } +}, { + "@type" : "g:Vertex", + "@value" : { +"id" : { + "@type" : "g:Int32", + "@value" : 7 +}, +"label" : "person", +"properties" : { + "name" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 1 + }, + "value" : "stephen", + "label" : "name" +} + } ], + "location" : [ { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 10 + }, + "value" : "centreville", + "label" : "location", + "properties" : { +"startTime" : { + "@type" : "g:Int32", + "@value" : 1990 +}, +"endTime" : { + "@type" : "g:Int32", + "@value" : 2000 +} + } +} + }, { +"@type" : "g:VertexProperty", +"@value" : { + "id" : { +"@type" : "g:Int64", +"@value" : 11 + }, + "value" : "dulles", + "label" : "location", +
[15/24] tinkerpop git commit: Added io test data for 3.2.9. CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9a586895/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json new file mode 100644 index 000..db030dd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_2_9/tree-v1d0.json @@ -0,0 +1,276 @@ +{ + "1" : { +"key" : { + "id" : 1, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 0, + "value" : "marko" +} ], +"location" : [ { + "id" : 6, + "value" : "san diego", + "properties" : { +"startTime" : 1997, +"endTime" : 2001 + } +}, { + "id" : 7, + "value" : "santa cruz", + "properties" : { +"startTime" : 2001, +"endTime" : 2004 + } +}, { + "id" : 8, + "value" : "brussels", + "properties" : { +"startTime" : 2004, +"endTime" : 2005 + } +}, { + "id" : 9, + "value" : "santa fe", + "properties" : { +"startTime" : 2005 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +}, +"value" : { + "11" : { +"key" : { + "id" : 11, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 5, + "value" : "tinkergraph" +} ] + } +}, +"value" : { } + } +} + } +} + }, + "7" : { +"key" : { + "id" : 7, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 1, + "value" : "stephen" +} ], +"location" : [ { + "id" : 10, + "value" : "centreville", + "properties" : { +"startTime" : 1990, +"endTime" : 2000 + } +}, { + "id" : 11, + "value" : "dulles", + "properties" : { +"startTime" : 2000, +"endTime" : 2006 + } +}, { + "id" : 12, + "value" : "purcellville", + "properties" : { +"startTime" : 2006 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +}, +"value" : { + "11" : { +"key" : { + "id" : 11, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 5, + "value" : "tinkergraph" +} ] + } +}, +"value" : { } + } +} + } +} + }, + "8" : { +"key" : { + "id" : 8, + "label" : "person", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 2, + "value" : "matthias" +} ], +"location" : [ { + "id" : 13, + "value" : "bremen", + "properties" : { +"startTime" : 2004, +"endTime" : 2007 + } +}, { + "id" : 14, + "value" : "baltimore", + "properties" : { +"startTime" : 2007, +"endTime" : 2011 + } +}, { + "id" : 15, + "value" : "oakland", + "properties" : { +"startTime" : 2011, +"endTime" : 2014 + } +}, { + "id" : 16, + "value" : "seattle", + "properties" : { +"startTime" : 2014 + } +} ] + } +}, +"value" : { + "10" : { +"key" : { + "id" : 10, + "label" : "software", + "type" : "vertex", + "properties" : { +"name" : [ { + "id" : 4, + "value" : "gremlin" +} ] + } +
[14/24] tinkerpop git commit: Added io tests for 3.3.3 CTR
Added io tests for 3.3.3 CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/27778e0d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/27778e0d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/27778e0d Branch: refs/heads/TINKERPOP-1628 Commit: 27778e0dfaa62622a3827b284cb07aa8316457b5 Parents: 81add60 Author: Stephen MalletteAuthored: Mon Apr 23 07:49:36 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 23 13:05:17 2018 -0400 -- .../io/graphson/GraphSONCompatibility.java | 6 +- .../structure/io/gryo/GryoCompatibility.java| 4 +- .../GraphSONTypedCompatibilityTest.java | 4 +- .../GraphSONUntypedCompatibilityTest.java | 6 +- .../io/gryo/GryoCompatibilityTest.java | 4 +- .../_3_3_3/authenticationchallenge-v1d0.json| 12 + .../authenticationchallenge-v2d0-no-types.json | 12 + .../authenticationchallenge-v2d0-partial.json | 12 + .../_3_3_3/authenticationchallenge-v3d0.json| 18 + .../_3_3_3/authenticationresponse-v1d0.json | 9 + .../authenticationresponse-v2d0-no-types.json | 9 + .../authenticationresponse-v2d0-partial.json| 9 + .../_3_3_3/authenticationresponse-v3d0.json | 9 + .../graphson/_3_3_3/barrier-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/barrier-v3d0.json| 4 + .../_3_3_3/bigdecimal-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/bigdecimal-v3d0.json | 4 + .../_3_3_3/biginteger-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/biginteger-v3d0.json | 4 + .../graphson/_3_3_3/binding-v2d0-partial.json | 10 + .../io/graphson/_3_3_3/binding-v3d0.json| 10 + .../io/graphson/_3_3_3/byte-v2d0-partial.json | 4 + .../structure/io/graphson/_3_3_3/byte-v3d0.json | 4 + .../_3_3_3/bytebuffer-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/bytebuffer-v3d0.json | 4 + .../graphson/_3_3_3/bytecode-v2d0-partial.json | 6 + .../io/graphson/_3_3_3/bytecode-v3d0.json | 6 + .../_3_3_3/cardinality-v2d0-partial.json| 4 + .../io/graphson/_3_3_3/cardinality-v3d0.json| 4 + .../io/graphson/_3_3_3/char-v2d0-partial.json | 4 + .../structure/io/graphson/_3_3_3/char-v3d0.json | 4 + .../io/graphson/_3_3_3/class-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/class-v3d0.json | 4 + .../io/graphson/_3_3_3/column-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/column-v3d0.json | 4 + .../io/graphson/_3_3_3/date-v2d0-no-types.json | 1 + .../io/graphson/_3_3_3/date-v2d0-partial.json | 4 + .../structure/io/graphson/_3_3_3/date-v3d0.json | 4 + .../graphson/_3_3_3/direction-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/direction-v3d0.json | 4 + .../graphson/_3_3_3/double-v2d0-no-types.json | 1 + .../io/graphson/_3_3_3/double-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/double-v3d0.json | 4 + .../graphson/_3_3_3/duration-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/duration-v3d0.json | 4 + .../structure/io/graphson/_3_3_3/edge-v1d0.json | 12 + .../io/graphson/_3_3_3/edge-v2d0-no-types.json | 14 + .../io/graphson/_3_3_3/edge-v2d0-partial.json | 32 + .../structure/io/graphson/_3_3_3/edge-v3d0.json | 32 + .../io/graphson/_3_3_3/float-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/float-v3d0.json | 4 + .../_3_3_3/inetaddress-v2d0-partial.json| 4 + .../io/graphson/_3_3_3/inetaddress-v3d0.json| 4 + .../graphson/_3_3_3/instant-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/instant-v3d0.json| 4 + .../graphson/_3_3_3/integer-v2d0-no-types.json | 1 + .../graphson/_3_3_3/integer-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/integer-v3d0.json| 4 + .../io/graphson/_3_3_3/lambda-v2d0-partial.json | 8 + .../io/graphson/_3_3_3/lambda-v3d0.json | 8 + .../structure/io/graphson/_3_3_3/list-v3d0.json | 7 + .../graphson/_3_3_3/localdate-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/localdate-v3d0.json | 4 + .../_3_3_3/localdatetime-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/localdatetime-v3d0.json | 4 + .../graphson/_3_3_3/localtime-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/localtime-v3d0.json | 4 + .../io/graphson/_3_3_3/long-v2d0-partial.json | 4 + .../structure/io/graphson/_3_3_3/long-v3d0.json | 4 + .../structure/io/graphson/_3_3_3/map-v3d0.json | 25 + .../graphson/_3_3_3/metrics-v2d0-partial.json | 54 ++ .../io/graphson/_3_3_3/metrics-v3d0.json| 52 ++ .../graphson/_3_3_3/monthday-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/monthday-v3d0.json | 4 + .../_3_3_3/offsetdatetime-v2d0-partial.json | 4 + .../io/graphson/_3_3_3/offsetdatetime-v3d0.json | 4 +
[08/24] 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/81add608 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/81add608 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/81add608 Branch: refs/heads/TINKERPOP-1628 Commit: 81add608549846e5f45e4e1a504e5e3cea6e03f9 Parents: 7e6e985 682f298 Author: Stephen MalletteAuthored: Fri Apr 20 19:29:17 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:29:17 2018 -0400 -- --
[05/24] 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/b8b46b06 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b8b46b06 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b8b46b06 Branch: refs/heads/TINKERPOP-1628 Commit: b8b46b06a26c58395ef2d878c2c2ed0665c0e788 Parents: 4705c04 6b259f7 Author: Stephen MalletteAuthored: Fri Apr 20 19:03:42 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:03:42 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8b46b06/CHANGELOG.asciidoc --
[17/24] tinkerpop git commit: Added io test data for 3.2.9. CTR
Added io test data for 3.2.9. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9a586895 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9a586895 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9a586895 Branch: refs/heads/TINKERPOP-1628 Commit: 9a5868959c6dec1c5757198289cbb23068e65a0f Parents: 27778e0 Author: Stephen MalletteAuthored: Mon Apr 23 13:04:12 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 23 13:05:26 2018 -0400 -- .../io/graphson/GraphSONCompatibility.java | 3 + .../structure/io/gryo/GryoCompatibility.java| 1 + .../GraphSONTypedCompatibilityTest.java | 1 + .../GraphSONUntypedCompatibilityTest.java | 2 + .../io/gryo/GryoCompatibilityTest.java | 1 + .../_3_2_9/authenticationchallenge-v1d0.json| 12 + .../authenticationchallenge-v2d0-no-types.json | 12 + .../authenticationchallenge-v2d0-partial.json | 12 + .../_3_2_9/authenticationresponse-v1d0.json | 9 + .../authenticationresponse-v2d0-no-types.json | 9 + .../authenticationresponse-v2d0-partial.json| 9 + .../graphson/_3_2_9/barrier-v2d0-no-types.json | 1 + .../graphson/_3_2_9/barrier-v2d0-partial.json | 4 + .../_3_2_9/bigdecimal-v2d0-partial.json | 1 + .../_3_2_9/biginteger-v2d0-partial.json | 1 + .../graphson/_3_2_9/binding-v2d0-no-types.json | 4 + .../graphson/_3_2_9/binding-v2d0-partial.json | 10 + .../io/graphson/_3_2_9/byte-v2d0-partial.json | 1 + .../_3_2_9/bytebuffer-v2d0-partial.json | 1 + .../graphson/_3_2_9/bytecode-v2d0-no-types.json | 3 + .../graphson/_3_2_9/bytecode-v2d0-partial.json | 6 + .../_3_2_9/cardinality-v2d0-no-types.json | 1 + .../_3_2_9/cardinality-v2d0-partial.json| 4 + .../io/graphson/_3_2_9/char-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/class-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/class-v2d0-partial.json | 4 + .../graphson/_3_2_9/column-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/column-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/date-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/date-v2d0-partial.json | 4 + .../_3_2_9/direction-v2d0-no-types.json | 1 + .../graphson/_3_2_9/direction-v2d0-partial.json | 4 + .../graphson/_3_2_9/double-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/double-v2d0-partial.json | 4 + .../graphson/_3_2_9/duration-v2d0-partial.json | 1 + .../structure/io/graphson/_3_2_9/edge-v1d0.json | 12 + .../io/graphson/_3_2_9/edge-v2d0-no-types.json | 14 + .../io/graphson/_3_2_9/edge-v2d0-partial.json | 32 + .../io/graphson/_3_2_9/float-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/float-v2d0-partial.json | 4 + .../_3_2_9/inetaddress-v2d0-partial.json| 1 + .../graphson/_3_2_9/instant-v2d0-partial.json | 1 + .../graphson/_3_2_9/integer-v2d0-no-types.json | 1 + .../graphson/_3_2_9/integer-v2d0-partial.json | 4 + .../graphson/_3_2_9/lambda-v2d0-no-types.json | 5 + .../io/graphson/_3_2_9/lambda-v2d0-partial.json | 8 + .../graphson/_3_2_9/localdate-v2d0-partial.json | 1 + .../_3_2_9/localdatetime-v2d0-partial.json | 1 + .../graphson/_3_2_9/localtime-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/long-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/long-v2d0-partial.json | 4 + .../graphson/_3_2_9/metrics-v2d0-no-types.json | 24 + .../graphson/_3_2_9/metrics-v2d0-partial.json | 54 ++ .../graphson/_3_2_9/monthday-v2d0-partial.json | 1 + .../_3_2_9/offsetdatetime-v2d0-partial.json | 1 + .../_3_2_9/offsettime-v2d0-partial.json | 1 + .../graphson/_3_2_9/operator-v2d0-no-types.json | 1 + .../graphson/_3_2_9/operator-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/order-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/order-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/p-v2d0-no-types.json | 4 + .../io/graphson/_3_2_9/p-v2d0-partial.json | 10 + .../io/graphson/_3_2_9/pand-v2d0-no-types.json | 10 + .../io/graphson/_3_2_9/pand-v2d0-partial.json | 25 + .../structure/io/graphson/_3_2_9/path-v1d0.json | 62 ++ .../io/graphson/_3_2_9/path-v2d0-no-types.json | 13 + .../io/graphson/_3_2_9/path-v2d0-partial.json | 34 + .../io/graphson/_3_2_9/period-v2d0-partial.json | 1 + .../io/graphson/_3_2_9/pick-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/pick-v2d0-partial.json | 4 + .../io/graphson/_3_2_9/pop-v2d0-no-types.json | 1 + .../io/graphson/_3_2_9/pop-v2d0-partial.json| 4 + .../io/graphson/_3_2_9/por-v2d0-no-types.json | 10 + .../io/graphson/_3_2_9/por-v2d0-partial.json| 31 + .../io/graphson/_3_2_9/property-v1d0.json | 4 + .../graphson/_3_2_9/property-v2d0-no-types.json | 4 +
[01/24] tinkerpop git commit: TINKERPOP-1936 Improved performance of Bytecode deserialization. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1628 0028cf43e -> 20948e328 (forced update) TINKERPOP-1936 Improved performance of Bytecode deserialization. GraphSON deserialization of Bytecode was using generic List deserialization which became especially costly for Jackson in 2.5.x because of changes that synchronized access to the deserialization cache and because the collection deserialization were no longer cacheable when type deserialization was in play. This change removed the use of generic type lists in deserialization and more directly handled the parsing of the lists thus bypassing the collection deserializer for this specific case. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e68df44c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e68df44c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e68df44c Branch: refs/heads/TINKERPOP-1628 Commit: e68df44caaafd9f4037da8e03be660a4124555eb Parents: a7c8ea1 Author: Stephen MalletteAuthored: Thu Apr 12 10:25:20 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 16 13:47:35 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e68df44c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 0f3a71a..51c9f68 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET) * Bumped to httpclient 4.5.5. +* Improved performance of GraphSON deserialization of `Bytecode`. [[release-3-2-8]] === TinkerPop 3.2.8 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e68df44c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java index a696280..040fd1d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java @@ -248,8 +248,6 @@ final class TraversalSerializersV2d0 { // final static class BytecodeJacksonDeserializer extends StdDeserializer { -private static final JavaType listJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object.class); -private static final JavaType listListJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, listJavaType); public BytecodeJacksonDeserializer() { super(Bytecode.class); @@ -260,17 +258,30 @@ final class TraversalSerializersV2d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the
[13/24] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json new file mode 100644 index 000..03f45cd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetDateTime", + "@value" : "2007-12-03T10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json new file mode 100644 index 000..03f45cd --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsetdatetime-v3d0.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetDateTime", + "@value" : "2007-12-03T10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json new file mode 100644 index 000..b124953 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetTime", + "@value" : "10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json new file mode 100644 index 000..b124953 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/offsettime-v3d0.json @@ -0,0 +1,4 @@ +{ + "@type" : "gx:OffsetTime", + "@value" : "10:15:30+01:00" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json new file mode 100644 index 000..14c1400 --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v2d0-partial.json @@ -0,0 +1,4 @@ +{ + "@type" : "g:Operator", + "@value" : "sum" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/_3_3_3/operator-v3d0.json new file mode 100644 index 000..14c1400 --- /dev/null +++
[02/24] tinkerpop git commit: Refactored SimpleAuthenticator to use the revised Credentials DSL
Refactored SimpleAuthenticator to use the revised Credentials DSL This should have been done on TINKERPOP-1903 but was missed CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1daf3f12 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1daf3f12 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1daf3f12 Branch: refs/heads/TINKERPOP-1628 Commit: 1daf3f12243a9a29ba3a00729a3fe4f2f76eccdd Parents: 38b85d2 Author: Stephen MalletteAuthored: Fri Apr 20 09:26:14 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 09:26:14 2018 -0400 -- .../server/auth/SimpleAuthenticator.java| 32 +--- 1 file changed, 15 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1daf3f12/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java index 8d90bf8..88e4e70 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java @@ -18,17 +18,17 @@ */ package org.apache.tinkerpop.gremlin.server.auth; -import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraph; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversal; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversalDsl; +import org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialTraversalSource; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.io.IoCore; import org.apache.tinkerpop.gremlin.structure.util.GraphFactory; import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; import org.mindrot.jbcrypt.BCrypt; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; import java.net.InetAddress; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -40,14 +40,14 @@ import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.Credenti /** * A simple implementation of an {@link Authenticator} that uses a {@link Graph} instance as a credential store. - * Management of the credential store can be handled through the {@link CredentialGraph} DSL. + * Management of the credential store can be handled through the {@link CredentialTraversalDsl} DSL. * * @author Stephen Mallette (http://stephen.genoprime.com) */ public class SimpleAuthenticator implements Authenticator { private static final Logger logger = LoggerFactory.getLogger(SimpleAuthenticator.class); private static final byte NUL = 0; -private CredentialGraph credentialStore; +private CredentialTraversalSource credentialStore; /** * The location of the configuration file that contains the credentials database. @@ -82,7 +82,7 @@ public class SimpleAuthenticator implements Authenticator { tinkerGraph.createIndex(PROPERTY_USERNAME, Vertex.class); } -credentialStore = CredentialGraph.credentials(graph); +credentialStore = graph.traversal(CredentialTraversalSource.class); logger.info("CredentialGraph initialized at {}", credentialStore); } @@ -98,17 +98,15 @@ public class SimpleAuthenticator implements Authenticator { final String username = credentials.get(PROPERTY_USERNAME); final String password = credentials.get(PROPERTY_PASSWORD); -try { -user = credentialStore.findUser(username); -} catch (IllegalStateException ex) { -// typically thrown when there are multiple users with the same name in the credential store -logger.warn(ex.getMessage()); -throw new AuthenticationException("Username and/or password are incorrect", ex); -} catch (Exception ex) { -throw new AuthenticationException("Username and/or password are incorrect", ex); -} +final CredentialTraversal t = credentialStore.users(username); +if (!t.hasNext()) +throw new AuthenticationException("Username and/or password are incorrect"); -if (null == user) throw new AuthenticationException("Username and/or password are incorrect"); +user = t.next(); +if (t.hasNext()) { +logger.warn("There is
[10/24] tinkerpop git commit: Improve JavaScript Gremlin documentation
Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/TINKERPOP-1628 Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics; g.V().repeat(__.out()).times(2).values("name").fold().toList();
[22/24] 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/8005cb3e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8005cb3e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8005cb3e Branch: refs/heads/TINKERPOP-1628 Commit: 8005cb3eecffe2ff64e06e669784564641c3e64d Parents: ffaca89 8462f85 Author: Stephen MalletteAuthored: Tue Apr 24 09:20:51 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:20:51 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8005cb3e/gremlin-python/src/main/jython/radish/feature_steps.py --
[23/24] tinkerpop git commit: TINKERPOP-1628 Implemented TraversalSelectStep
TINKERPOP-1628 Implemented TraversalSelectStep Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/57e2c00c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/57e2c00c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/57e2c00c Branch: refs/heads/TINKERPOP-1628 Commit: 57e2c00c95c67db34c2dd45200b1a92bb2624e5e Parents: 8005cb3 Author: Daniel KuppitzAuthored: Thu Apr 19 18:06:02 2018 -0700 Committer: Daniel Kuppitz Committed: Tue Apr 24 06:30:29 2018 -0700 -- CHANGELOG.asciidoc | 1 + docs/src/recipes/shortest-path.asciidoc | 39 + docs/src/reference/the-traversal.asciidoc | 16 ++ .../traversal/dsl/graph/GraphTraversal.java | 30 .../gremlin/process/traversal/dsl/graph/__.java | 14 ++ .../traversal/step/map/TraversalSelectStep.java | 157 +++ .../Process/Traversal/GraphTraversal.cs | 18 +++ .../src/Gremlin.Net/Process/Traversal/__.cs | 16 ++ gremlin-test/features/map/Select.feature| 18 ++- .../process/traversal/step/map/SelectTest.java | 15 ++ .../structure/TinkerGraphPlayTest.java | 114 +++--- 11 files changed, 415 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57e2c00c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index aead6ef..812d44a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -74,6 +74,7 @@ This release also includes changes from < >. * TINKERPOP-1357 Centrality Recipes should mention pageRank and OLAP. * TINKERPOP-1489 Provide a Javascript Gremlin Language Variant * TINKERPOP-1586 SubgraphStrategy in OLAP +* TINKERPOP-1628 Implement TraversalSelectStep. * TINKERPOP-1726 Support WebSockets ping/pong keep-alive in Gremlin server * TINKERPOP-1842 iterate() missing in terminal steps documentation * TINKERPOP-1844 Python GLV test should run for GraphSON 3.0 *(breaking)* http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57e2c00c/docs/src/recipes/shortest-path.asciidoc -- diff --git a/docs/src/recipes/shortest-path.asciidoc b/docs/src/recipes/shortest-path.asciidoc index 04301f1..2e33055 100644 --- a/docs/src/recipes/shortest-path.asciidoc +++ b/docs/src/recipes/shortest-path.asciidoc @@ -95,5 +95,44 @@ calculated cost. With some slight modifications given the use of `select` it bec the output. Note that the path with the lowest "cost" actually has a longer path length as determined by the graph structure. +The following query illustrates how `select()` can be used to find all shortest weighted undirected paths +in the modern toy graph. +[gremlin-groovy,modern] + +g.withSack(0.0).V().as("from"). <1> + repeat(bothE(). + sack(sum). + by("weight"). + otherV().<2> + where(neq("from")).as("to"). <3> + group("m"). <4> + by(select("from","to")). + by(sack().min()). + filter(project("s","x"). <5> + by(sack()). + by(select("m").select(select("from","to"))). +where("s", eq("x"))). + group("p"). <6> + by(select("from", "to")). + by(map(union(path().by("name").by("weight"), +sack()).fold())). + barrier()). + cap("p").unfold(). + order().<7> +by(select(keys).select("from").id()). +by(select(keys).select("to").id()). + barrier(). + dedup().<8> +by(select(keys).select(values).order(local).by(id)) + + +<1> Start the traversal from all vertices with an initial sack value of 0. +<2> Traverse into all directions and sum up the edge weight values. +<3> Filter out the initial start vertex. +<4> For the current start and end vertex, update the minimum sack value (weighted length of the path). +<5> Compare the current weighted path length to the current minimum weighted path length between the 2 vertices. Eliminate traversers that found a path that is longer than the current shortest path. +<6> Update the path and weighted path length for the current start and end vertex pair. +<7> Order the output by the start vertex id and then the end vertex id (for better readability). +<8> Deduplicate vertex pairs (the shortest path from `v[1]` to `v[6]` is the same as the path from `v[6]` to `v[1]`). http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57e2c00c/docs/src/reference/the-traversal.asciidoc
[24/24] tinkerpop git commit: Adressed comments made by @spmallette
Adressed comments made by @spmallette Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/20948e32 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/20948e32 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/20948e32 Branch: refs/heads/TINKERPOP-1628 Commit: 20948e328292ea6b8f3c448a5d453f3f6d218258 Parents: 57e2c00 Author: Daniel KuppitzAuthored: Tue Apr 24 06:29:16 2018 -0700 Committer: Daniel Kuppitz Committed: Tue Apr 24 06:30:29 2018 -0700 -- CHANGELOG.asciidoc | 2 +- docs/src/reference/the-traversal.asciidoc | 2 ++ gremlin-test/features/map/Select.feature| 28 + .../process/AbstractGremlinProcessTest.java | 14 + .../process/traversal/step/map/SelectTest.java | 33 5 files changed, 78 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20948e32/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 812d44a..ab20fff 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 < >. +* Implemented `TraversalSelectStep` which allows to `select()` runtime-generated keys. * Coerced `BulkSet` to `g:List` in GraphSON 3.0. * Deprecated `CredentialsGraph` DSL in favor of `CredentialsTraversalDsl` which uses the recommended method for Gremlin DSL development. @@ -74,7 +75,6 @@ This release also includes changes from < >. * TINKERPOP-1357 Centrality Recipes should mention pageRank and OLAP. * TINKERPOP-1489 Provide a Javascript Gremlin Language Variant * TINKERPOP-1586 SubgraphStrategy in OLAP -* TINKERPOP-1628 Implement TraversalSelectStep. * TINKERPOP-1726 Support WebSockets ping/pong keep-alive in Gremlin server * TINKERPOP-1842 iterate() missing in terminal steps documentation * TINKERPOP-1844 Python GLV test should run for GraphSON 3.0 *(breaking)* http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20948e32/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 27a97fd..11f24e4 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -2385,6 +2385,8 @@ link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/grem link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#select-org.apache.tinkerpop.gremlin.process.traversal.Pop-java.lang.String-++[`select(Pop,String)`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#select-java.lang.String-++[`select(String)`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#select-java.lang.String-java.lang.String-java.lang.String...-++[`select(String,String,String...)`], +link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#select-org.apache.tinkerpop.gremlin.process.traversal.Traversal-++[`select(Traversal)`], +link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#select-org.apache.tinkerpop.gremlin.process.traversal.Pop-org.apache.tinkerpop.gremlin.process.traversal.Traversal-++[`select(Pop,Traversal)`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/structure/Column.html++[`Column`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/Pop.html++[`Pop`] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20948e32/gremlin-test/features/map/Select.feature -- diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature index 54c15cc..713dd81 100644 --- a/gremlin-test/features/map/Select.feature +++ b/gremlin-test/features/map/Select.feature @@ -531,3 +531,31 @@ Feature: Step - select() | d[3].l | | d[1].l | | d[1].l | + + Scenario: g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX +Given the modern graph +And the traversal of + """ +
[09/24] tinkerpop git commit: Fix typos in GraphManager and DefaultGraphManager javadoc
Fix typos in GraphManager and DefaultGraphManager javadoc Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/268423d2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/268423d2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/268423d2 Branch: refs/heads/TINKERPOP-1628 Commit: 268423d2d16397ad749082041ea0e17075a3093d Parents: 682f298 Author: Justin Chu <15710241+justinch...@users.noreply.github.com> Authored: Fri Apr 20 22:47:31 2018 -0400 Committer: Justin Chu <15710241+justinch...@users.noreply.github.com> Committed: Fri Apr 20 22:52:30 2018 -0400 -- .../java/org/apache/tinkerpop/gremlin/server/GraphManager.java | 4 ++-- .../tinkerpop/gremlin/server/util/DefaultGraphManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/268423d2/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java index 8e3198f..bcb4a8e 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java @@ -69,8 +69,8 @@ public interface GraphManager { * * @return a {@link Map} where the key is the name of the {@link TraversalSource} and the value is the * {@link TraversalSource} itself - * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and - * {@link #getTraversalSource(String)} (String)} - note that the expectation is this method return an immutable + * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and + * {@link #getTraversalSource(String)} - note that the expectation is this method return an immutable * {@code Map} which was not the expectation prior to 3.2.5. */ @Deprecated http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/268423d2/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java -- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java index 5e4a355..9b5668f 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/DefaultGraphManager.java @@ -96,8 +96,8 @@ public final class DefaultGraphManager implements GraphManager { * * @return a {@code Map} where the key is the name of the {@link TraversalSource} and the value is the * {@link TraversalSource} itself - * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSource(String)} ()} and - * {@link #getTraversalSource(String)} (String)} + * @deprecated As of release 3.2.5, replaced by a combination of {@link #getTraversalSourceNames()} and + * {@link #getTraversalSource(String)} */ @Deprecated public final MapgetTraversalSources() {
[20/24] 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/ffaca891 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ffaca891 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ffaca891 Branch: refs/heads/TINKERPOP-1628 Commit: ffaca8915e3df4952c02c922045a224176e07037 Parents: ead5659 c155818 Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:31 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:31 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffaca891/docs/src/reference/gremlin-variants.asciidoc --
[18/24] 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/ead56590 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ead56590 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ead56590 Branch: refs/heads/TINKERPOP-1628 Commit: ead56590a6374d5757b53a5412bef47b87c1e4b2 Parents: 9a58689 268423d Author: Stephen MalletteAuthored: Mon Apr 23 13:50:29 2018 -0400 Committer: Stephen Mallette Committed: Mon Apr 23 13:50:29 2018 -0400 -- .../java/org/apache/tinkerpop/gremlin/server/GraphManager.java | 4 ++-- .../tinkerpop/gremlin/server/util/DefaultGraphManager.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --
[19/24] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/TINKERPOP-1628 Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[21/24] tinkerpop git commit: Added Pop.all to python gherkin test support
Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/TINKERPOP-1628 Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
[06/24] tinkerpop git commit: TINKERPOP-1936 Implemented bytecode serialization performance enhancement for GraphSON 3.0
TINKERPOP-1936 Implemented bytecode serialization performance enhancement for 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/7e6e9854 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7e6e9854 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7e6e9854 Branch: refs/heads/TINKERPOP-1628 Commit: 7e6e98548625c83ad419737166fe6c679d204468 Parents: b8b46b0 Author: Stephen MalletteAuthored: Fri Apr 20 19:26:05 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:26:05 2018 -0400 -- .../io/graphson/TraversalSerializersV3d0.java | 33 ++-- 1 file changed, 23 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7e6e9854/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java index fd11f25..eaa7b0f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java @@ -252,17 +252,30 @@ final class TraversalSerializersV3d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the start array +jsonParser.nextToken(); + +final String stepName = jsonParser.getText(); + +// iterate through the rest of the list for arguments until it gets to the end +final List arguments = new ArrayList<>(); +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { +// we don't know the types here, so let the deserializer figure that business out + arguments.add(deserializationContext.readValue(jsonParser, Object.class)); +} + +// if it's not a "source" then it must be a "step" +if (current.equals(GraphSONTokens.SOURCE)) +bytecode.addSource(stepName, arguments.toArray()); +else +bytecode.addStep(stepName, arguments.toArray()); } } }
[03/24] tinkerpop git commit: Shutdown server in test to try to ensure log flush for assertion
Shutdown server in test to try to ensure log flush for assertion Tests that check logs for assertions tend to randomly fail despite a number of attempt to try to harden them. In this attempt I shutdown the server prior to log assertion in the hopes that it will flush everything through and prevent failures. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4705c041 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4705c041 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4705c041 Branch: refs/heads/TINKERPOP-1628 Commit: 4705c0416d522cce4d8c6ec498215f7f446fee4d Parents: 1daf3f1 Author: Stephen MalletteAuthored: Fri Apr 20 10:56:34 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 10:56:34 2018 -0400 -- .../tinkerpop/gremlin/server/GremlinServerIntegrateTest.java | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4705c041/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java -- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 6454ad5..a1689e9 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -327,9 +327,12 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration // there record Thread.sleep(3000); -assertThat(recordingAppender.logContainsAny(".*Checking channel - sending ping to client after idle period of .*$"), is(true)); - client.close(); + +// stop the server to be sure that logs flush +stopServer(); + +assertThat(recordingAppender.logContainsAny(".*Checking channel - sending ping to client after idle period of .*$"), is(true)); } @Test
[07/24] tinkerpop git commit: TINKERPOP-1936 Improved performance of Bytecode deserialization.
TINKERPOP-1936 Improved performance of Bytecode deserialization. GraphSON deserialization of Bytecode was using generic List deserialization which became especially costly for Jackson in 2.5.x because of changes that synchronized access to the deserialization cache and because the collection deserialization were no longer cacheable when type deserialization was in play. This change removed the use of generic type lists in deserialization and more directly handled the parsing of the lists thus bypassing the collection deserializer for this specific case. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/682f298c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/682f298c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/682f298c Branch: refs/heads/TINKERPOP-1628 Commit: 682f298cc82d66fd7040cb29a7d3b769be5e2794 Parents: 2591302 Author: Stephen MalletteAuthored: Thu Apr 12 10:25:20 2018 -0400 Committer: Stephen Mallette Committed: Fri Apr 20 19:29:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/TraversalSerializersV2d0.java | 35 +--- 2 files changed, 24 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682f298c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 0f3a71a..51c9f68 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET) * Bumped to httpclient 4.5.5. +* Improved performance of GraphSON deserialization of `Bytecode`. [[release-3-2-8]] === TinkerPop 3.2.8 (Release Date: April 2, 2018) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/682f298c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java index a696280..040fd1d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java @@ -248,8 +248,6 @@ final class TraversalSerializersV2d0 { // final static class BytecodeJacksonDeserializer extends StdDeserializer { -private static final JavaType listJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, Object.class); -private static final JavaType listListJavaType = TypeFactory.defaultInstance().constructCollectionType(ArrayList.class, listJavaType); public BytecodeJacksonDeserializer() { super(Bytecode.class); @@ -260,17 +258,30 @@ final class TraversalSerializersV2d0 { final Bytecode bytecode = new Bytecode(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { -if (jsonParser.getCurrentName().equals(GraphSONTokens.SOURCE)) { +final String current = jsonParser.getCurrentName(); +if (current.equals(GraphSONTokens.SOURCE) || current.equals(GraphSONTokens.STEP)) { jsonParser.nextToken(); -final List instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addSource((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); -} -} else if (jsonParser.getCurrentName().equals(GraphSONTokens.STEP)) { -jsonParser.nextToken(); -final List
instructions = deserializationContext.readValue(jsonParser, listListJavaType); -for (final List instruction : instructions) { -bytecode.addStep((String) instruction.get(0), Arrays.copyOfRange(instruction.toArray(), 1, instruction.size())); + +while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + +// there should be a list now and the first item in the list is always string and is the step name +// skip the start array +jsonParser.nextToken(); + +
[11/24] tinkerpop git commit: Added io tests for 3.3.3 CTR
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo new file mode 100644 index 000..ba94b5d Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v1d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo new file mode 100644 index 000..ba94b5d Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytebuffer-v3d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo new file mode 100644 index 000..edf8dd4 Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v1d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo new file mode 100644 index 000..edf8dd4 Binary files /dev/null and b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/bytecode-v3d0.kryo differ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo new file mode 100644 index 000..71bd63e --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v1d0.kryo @@ -0,0 +1 @@ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo new file mode 100644 index 000..71bd63e --- /dev/null +++ b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/cardinality-v3d0.kryo @@ -0,0 +1 @@ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27778e0d/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo -- diff --git a/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo b/gremlin-tools/gremlin-io-test/src/test/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/_3_3_3/char-v1d0.kryo new file mode 100644 index 000..718882c Binary files
[1/3] tinkerpop git commit: Added Pop.all to python gherkin test support
Repository: tinkerpop Updated Branches: refs/heads/master 56b022563 -> 4a078f9e3 Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/master Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
[3/3] 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/4a078f9e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4a078f9e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4a078f9e Branch: refs/heads/master Commit: 4a078f9e353619826f69404b43c08be0bbac8365 Parents: 56b0225 8005cb3 Author: Stephen MalletteAuthored: Tue Apr 24 09:21:03 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:21:03 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) --
[2/2] 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/8005cb3e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8005cb3e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8005cb3e Branch: refs/heads/tp33 Commit: 8005cb3eecffe2ff64e06e669784564641c3e64d Parents: ffaca89 8462f85 Author: Stephen MalletteAuthored: Tue Apr 24 09:20:51 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:20:51 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8005cb3e/gremlin-python/src/main/jython/radish/feature_steps.py --
[2/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/8005cb3e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8005cb3e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8005cb3e Branch: refs/heads/master Commit: 8005cb3eecffe2ff64e06e669784564641c3e64d Parents: ffaca89 8462f85 Author: Stephen MalletteAuthored: Tue Apr 24 09:20:51 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:20:51 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8005cb3e/gremlin-python/src/main/jython/radish/feature_steps.py --
[1/2] tinkerpop git commit: Added Pop.all to python gherkin test support
Repository: tinkerpop Updated Branches: refs/heads/tp33 ffaca8915 -> 8005cb3ee Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/tp33 Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
tinkerpop git commit: Added Pop.all to python gherkin test support
Repository: tinkerpop Updated Branches: refs/heads/tp32 c15581879 -> 8462f857d Added Pop.all to python gherkin test support Pop.all in python is Pop.all_ in python - needed that translation for tests that use that expression CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8462f857 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8462f857 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8462f857 Branch: refs/heads/tp32 Commit: 8462f857d78a11e4d383fdc077fe8bb8688cbe67 Parents: c155818 Author: Stephen MalletteAuthored: Tue Apr 24 09:17:18 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 09:17:18 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8462f857/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 5cf9059..80137b0 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -25,6 +25,7 @@ from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope from radish import given, when, then from hamcrest import * +regex_all = re.compile(r"Pop\.all") regex_and = re.compile(r"([(.,\s])and\(") regex_as = re.compile(r"([(.,\s])as\(") regex_from = re.compile(r"([(.,\s])from\(") @@ -233,6 +234,7 @@ def _table_assertion(data, result, ctx, ordered): def _translate(traversal): replaced = traversal.replace("\n", "") +replaced = regex_all.sub(r"Pop.all_", replaced) replaced = regex_and.sub(r"\1and_(", replaced) replaced = regex_from.sub(r"\1from_(", replaced) replaced = regex_global.sub(r"\1global_", replaced)
[3/6] tinkerpop git commit: TINKERPOP-1595 Removed stream() usage
TINKERPOP-1595 Removed stream() usage Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e92bd701 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e92bd701 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e92bd701 Branch: refs/heads/TINKERPOP-1595 Commit: e92bd70171a9de219bb16fc60f6edbabd3cbecbf Parents: d11d3b8 Author: Stephen MalletteAuthored: Tue Apr 24 08:02:31 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 08:02:31 2018 -0400 -- .../traversal/step/map/TraversalVertexProgramStep.java| 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e92bd701/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java index e866ce2..a49cc27 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java @@ -32,6 +32,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequire import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; import java.util.Collections; import java.util.List; @@ -73,11 +74,10 @@ public final class TraversalVertexProgramStep extends VertexProgramStep implemen public TraversalVertexProgram generateProgram(final Graph graph, final Memory memory) { final Traversal.Admin computerSpecificTraversal = this.computerTraversal.getPure(); final TraversalStrategies computerSpecificStrategies = this.getTraversal().getStrategies().clone(); -TraversalStrategies.GlobalCache.getStrategies(graph.getClass()) -.toList() -.stream() -.filter(s -> s instanceof TraversalStrategy.ProviderOptimizationStrategy) -.forEach(computerSpecificStrategies::addStrategies); + + IteratorUtils.filter(TraversalStrategies.GlobalCache.getStrategies(graph.getClass()).toList(), +s -> s instanceof TraversalStrategy.ProviderOptimizationStrategy).forEach(computerSpecificStrategies::addStrategies); + computerSpecificTraversal.setStrategies(computerSpecificStrategies); computerSpecificTraversal.setSideEffects(new MemoryTraversalSideEffects(this.getTraversal().getSideEffects())); computerSpecificTraversal.setParent(this);
[5/6] tinkerpop git commit: TINKERPOP-1595 Changed vertex program serialization to base64 encoded
TINKERPOP-1595 Changed vertex program serialization to base64 encoded This approach shows to be faster than writing the bytes as an array of string values and deserializing with regex based parsing. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/318eab50 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/318eab50 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/318eab50 Branch: refs/heads/TINKERPOP-1595 Commit: 318eab50defedf8717220161cde7690ca76bb973 Parents: d61765e Author: Stephen MalletteAuthored: Tue Apr 24 08:06:56 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 08:06:56 2018 -0400 -- .../process/computer/util/VertexProgramHelper.java | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/318eab50/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java index bc67866..a1c299d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/VertexProgramHelper.java @@ -28,7 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep; import org.apache.tinkerpop.gremlin.util.Serializer; import java.io.IOException; -import java.util.Arrays; +import java.util.Base64; import java.util.HashSet; import java.util.Set; @@ -64,8 +64,7 @@ public final class VertexProgramHelper { if (configuration instanceof AbstractConfiguration) ((AbstractConfiguration) configuration).setDelimiterParsingDisabled(true); try { -final String byteString = Arrays.toString(Serializer.serializeObject(object)); -configuration.setProperty(key, byteString.substring(1, byteString.length() - 1)); +configuration.setProperty(key, Base64.getEncoder().encodeToString(Serializer.serializeObject(object))); } catch (final IOException e) { throw new IllegalArgumentException(e.getMessage(), e); } @@ -73,12 +72,8 @@ public final class VertexProgramHelper { public static T deserialize(final Configuration configuration, final String key) { try { -final String[] stringBytes = configuration.getString(key).split(","); -byte[] bytes = new byte[stringBytes.length]; -for (int i = 0; i < stringBytes.length; i++) { -bytes[i] = Byte.valueOf(stringBytes[i].trim()); -} -return (T) Serializer.deserializeObject(bytes); + +return (T) Serializer.deserializeObject(Base64.getDecoder().decode(configuration.getString(key).getBytes())); } catch (final IOException | ClassNotFoundException e) { throw new IllegalArgumentException(e.getMessage(), e); }
[4/6] tinkerpop git commit: TINKERPOP-1595 Refactored reflective lookups for clone()
TINKERPOP-1595 Refactored reflective lookups for clone() Rather than iterate all methods to find clone() just call getMethod() and call that if found. Nothing seems to be exercising this bit of code in our test suite. I forced it by adding clone() temporarily to RangeBiOperator and it worked without issue. Not sure how else to test this. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d61765e8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d61765e8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d61765e8 Branch: refs/heads/TINKERPOP-1595 Commit: d61765e81636f1c019fc0dc1406cd80de53ce6fa Parents: e92bd70 Author: Stephen MalletteAuthored: Tue Apr 24 08:03:28 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 08:03:28 2018 -0400 -- .../gremlin/process/computer/MemoryComputeKey.java | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d61765e8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java index 70adf3d..a9b1532 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/MemoryComputeKey.java @@ -79,14 +79,17 @@ public final class MemoryComputeKey implements Serializable, Cloneable { public MemoryComputeKey clone() { try { final MemoryComputeKey clone = (MemoryComputeKey) super.clone(); -for (final Method method : this.reducer.getClass().getMethods()) { -if (method.getName().equals("clone") && 0 == method.getParameterCount()) { -clone.reducer = (BinaryOperator) method.invoke(this.reducer); -break; -} + +try { +final Method cloneMethod = this.reducer.getClass().getMethod("clone"); +if (cloneMethod != null) +clone.reducer = (BinaryOperator) cloneMethod.invoke(this.reducer); +} catch(Exception ignored) { + } + return clone; -} catch (final IllegalAccessException | InvocationTargetException | CloneNotSupportedException e) { +} catch (final CloneNotSupportedException e) { throw new IllegalStateException(e.getMessage(), e); } }
[6/6] tinkerpop git commit: TINKERPOP-1595 Updated changelog
TINKERPOP-1595 Updated changelog Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7869eb6f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7869eb6f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7869eb6f Branch: refs/heads/TINKERPOP-1595 Commit: 7869eb6f2d1845d632ab0c74e1c62583086d6107 Parents: 318eab5 Author: Stephen MalletteAuthored: Tue Apr 24 08:10:12 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 08:10:12 2018 -0400 -- CHANGELOG.asciidoc | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7869eb6f/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 51c9f68..4a5aab6 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima === TinkerPop 3.2.9 (Release Date: NOT OFFICIALLY RELEASED YET) * Bumped to httpclient 4.5.5. +* Improved performance of `TraversalVertexProgram` and related infrastructure. * Improved performance of GraphSON deserialization of `Bytecode`. [[release-3-2-8]]
[2/6] tinkerpop git commit: TINKERPOP-1595 Removed stream() usage
TINKERPOP-1595 Removed stream() usage Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d11d3b81 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d11d3b81 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d11d3b81 Branch: refs/heads/TINKERPOP-1595 Commit: d11d3b816bec848679169fa261c75d4e8c172974 Parents: d8f55c0 Author: Stephen MalletteAuthored: Tue Apr 24 08:00:48 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 08:00:48 2018 -0400 -- .../process/computer/traversal/TraversalVertexProgram.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d11d3b81/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java index 3cb4d00..40417cc 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java @@ -175,12 +175,11 @@ public final class TraversalVertexProgram implements VertexProgram strategy instanceof HaltedTraverserStrategy) -.findAny() -.orElse(HaltedTraverserStrategy.reference())); +final Iterator itty = IteratorUtils.filter(this.traversal.get().getStrategies().toList(), strategy -> strategy instanceof HaltedTraverserStrategy).iterator(); +this.haltedTraverserStrategy = itty.hasNext() ? (HaltedTraverserStrategy) itty.next() : HaltedTraverserStrategy.reference(); + // register traversal side-effects in memory this.memoryComputeKeys.addAll(MemoryTraversalSideEffects.getMemoryComputeKeys(this.traversal.get())); // register MapReducer memory compute keys
[1/6] tinkerpop git commit: TINKERPOP-1595 Removed usage of deprecated graph computer method
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1595 [created] 7869eb6f2 TINKERPOP-1595 Removed usage of deprecated graph computer method Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d8f55c09 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d8f55c09 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d8f55c09 Branch: refs/heads/TINKERPOP-1595 Commit: d8f55c09e318220400647d410923e1af97e7cca9 Parents: 268423d Author: Stephen MalletteAuthored: Tue Apr 24 07:59:58 2018 -0400 Committer: Stephen Mallette Committed: Tue Apr 24 07:59:58 2018 -0400 -- .../process/computer/traversal/step/map/VertexProgramStep.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d8f55c09/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java index d005940..b32ef82 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/VertexProgramStep.java @@ -72,7 +72,7 @@ public abstract class VertexProgramStep extends AbstractStep
[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/56b02256 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/56b02256 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/56b02256 Branch: refs/heads/master Commit: 56b0225635533415ae87c56efb28c771e89f900b Parents: 250994d ffaca89 Author: Jorge Bay GondraAuthored: Tue Apr 24 10:42:10 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:42:10 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[1/2] tinkerpop git commit: Improve JavaScript Gremlin documentation
Repository: tinkerpop Updated Branches: refs/heads/tp32 268423d2d -> c15581879 Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/tp32 Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics;
[2/4] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/master Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[2/3] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/tp33 Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[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/ffaca891 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ffaca891 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ffaca891 Branch: refs/heads/tp33 Commit: ffaca8915e3df4952c02c922045a224176e07037 Parents: ead5659 c155818 Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:31 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:31 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffaca891/docs/src/reference/gremlin-variants.asciidoc --
[2/2] tinkerpop git commit: Merge branch 'js-doc-example' into tp32
Merge branch 'js-doc-example' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1558187 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1558187 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1558187 Branch: refs/heads/tp32 Commit: c155818793c38a144edfa5bc803284ff82c2e8ca Parents: 268423d e08651b Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:17 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:17 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) --
[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/ffaca891 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ffaca891 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ffaca891 Branch: refs/heads/master Commit: ffaca8915e3df4952c02c922045a224176e07037 Parents: ead5659 c155818 Author: Jorge Bay GondraAuthored: Tue Apr 24 10:39:31 2018 +0200 Committer: Jorge Bay Gondra Committed: Tue Apr 24 10:39:31 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ffaca891/docs/src/reference/gremlin-variants.asciidoc --
[1/4] tinkerpop git commit: Improve JavaScript Gremlin documentation
Repository: tinkerpop Updated Branches: refs/heads/master 250994dbe -> 56b022563 Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/master Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics;
[1/3] tinkerpop git commit: Improve JavaScript Gremlin documentation
Repository: tinkerpop Updated Branches: refs/heads/tp33 ead56590a -> ffaca8915 Improve JavaScript Gremlin documentation Several fixes to the JavaScript GLV documentation: - Use 'gremlin' package name - Include information regarding Promises - Fix method names Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e08651b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e08651b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e08651b9 Branch: refs/heads/tp33 Commit: e08651b946e936579db538f9114dd1c5c9079bcb Parents: 2591302 Author: Jorge Bay GondraAuthored: Mon Apr 23 10:26:36 2018 +0200 Committer: Jorge Bay Gondra Committed: Mon Apr 23 10:26:36 2018 +0200 -- docs/src/reference/gremlin-variants.asciidoc | 47 +-- 1 file changed, 36 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e08651b9/docs/src/reference/gremlin-variants.asciidoc -- diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index d929b3c..7a85ab1 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -458,17 +458,24 @@ their Java counterparts which makes it possible to use lambdas with Gremlin.Net == Gremlin-JavaScript image:gremlin-js.png[width=130,float=right] Apache TinkerPop's Gremlin-JavaScript implements Gremlin within the -JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 4 or +JavaScript language. It targets Node.js runtime and can be used on different operating systems on any Node.js 6 or above. Since the JavaScript naming conventions are very similar to that of Java, it should be very easy to switch between Gremlin-Java and Gremlin-JavaScript. [source,bash] -npm install gremlin-javascript +npm install gremlin The Gremlin-JavaScript provides `GraphTraversalSource`, `GraphTraversal`, and `__` which mirror the respective classes in Gremlin-Java. The `GraphTraversalSource` requires a RemoteConnection implementation in order to communicate with < >. +[source,javascript] + +const gremlin = require('gremlin'); +const Graph = gremlin.structure.Graph; +const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; + + A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`. [source,javascript] @@ -489,27 +496,45 @@ IMPORTANT: Gremlin-JavaScriptâs `Traversal` base class supports the standard G === RemoteConnection Submission -Very similar to Gremlin-Python and Gremlin-Java, there are various ways to submit a traversal to a -`RemoteConnection` using terminal/action methods off of `Traversal`. +In a similar way as in other GLVs, there are various ways to submit a traversal to a +`RemoteConnection` using terminal/action methods off of `Traversal`. Given that I/O operations in Node.js are +asynchronous by default, this terminal methods return a `Promise`. -* `Traversal.next()` -* `Traversal.toList()` +* `Traversal.toList()`: Returns a `Promise` with an `Array` as result value. +* `Traversal.next()`: Returns a `Promise` with a `{ value, done }` tuple as result value, according to the +link:https://github.com/tc39/proposal-async-iteration[async iterator proposal]. +* `Traversal.iterate()`: Returns a `Promise` without a value. + + +For example: + +[source,javascript] + +g.V().hasLabel('person').values('name').toList() + .then(names => console.log(names)); + + +You can `await` the promises if you are using `async` functions. + +[source,javascript] + +const names = await g.V().hasLabel('person').values('name').toList(); +console.log(names); + === Static Enums and Methods Gremlin has various tokens (e.g. `t`, `P`, `order`, `direction`, etc.) that are represented in Gremlin-JavaScript as objects. -These can be used analogously to how they are used in Gremlin-Java. - [source,javascript] -g.V().hasLabel("person").has("age",P.gt(30)).Order().By("age", order.decr).toList() +g.V().hasLabel('person').has('age', P.gt(30)).order().by('age', order.decr).toList() These objects must be required manually from the `process` namespace: [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const P = gremlin.process.P; @@ -517,7 +542,7 @@ Finally, using static `__` anonymous traversals like `__.out()` can be expressed [source,javascript] -const gremlin = require('gremlin-javascript'); +const gremlin = require('gremlin'); const __ = gremlin.process.statics;