From commits-return-40497-archive-asf-public=cust-asf.ponee.io@tinkerpop.apache.org Wed Sep 2 15:40:44 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 30DDD180792 for ; Wed, 2 Sep 2020 17:40:44 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 969B062A69 for ; Wed, 2 Sep 2020 15:40:43 +0000 (UTC) Received: (qmail 92968 invoked by uid 500); 2 Sep 2020 15:40:43 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 92942 invoked by uid 99); 2 Sep 2020 15:40:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2020 15:40:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id CBCAC8087C; Wed, 2 Sep 2020 15:40:42 +0000 (UTC) Date: Wed, 02 Sep 2020 15:40:45 +0000 To: "commits@tinkerpop.apache.org" Subject: [tinkerpop] 03/03: Merge branch '3.4-dev' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: spmallette@apache.org In-Reply-To: <159906124228.31202.11666759146300582680@gitbox.apache.org> References: <159906124228.31202.11666759146300582680@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: tinkerpop X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 2661f8207aee4095151191e542f99a5d5fbee722 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20200902154042.CBCAC8087C@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git commit 2661f8207aee4095151191e542f99a5d5fbee722 Merge: 486bc5d a4a5579 Author: Stephen Mallette AuthorDate: Wed Sep 2 11:40:12 2020 -0400 Merge branch '3.4-dev' docs/src/reference/gremlin-variants.asciidoc | 50 ++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 11 deletions(-) diff --cc docs/src/reference/gremlin-variants.asciidoc index 7696bfd,1013c8a..24cabd1 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@@ -307,12 -312,11 +311,13 @@@ GraphTraversalSource g = traversal().wi The `IoRegistry` tells the serializer what classes from the graph provider to auto-register during serialization. Gremlin Server roughly uses this same approach when it configures its serializers, so using this same model will -ensure compatibility when making requests. Obviously, it is possible to switch to GraphSON or GraphBinary by building -the appropriate `MessageSerializer` (`GraphSONMessageSerializerV3d0` or `GraphBinaryMessageSerializerV1` respectively) +ensure compatibility when making requests. Obviously, it is possible to switch to GraphSON or Gryo by using +the appropriate `MessageSerializer` (e.g. `GraphSONMessageSerializerV3d0` or `GryoMessageSerializerV3d0` respectively) in the same way and building that into the `Cluster` object. +NOTE: Gryo is no longer the preferred binary serialization format for Gremlin Server - please prefer GraphBinary. + + [[gremlin-java-lambda]] === The Lambda Solution Supporting link:https://en.wikipedia.org/wiki/Anonymous_function[anonymous functions] across languages is difficult as @@@ -721,13 -727,13 +730,14 @@@ With statics loaded its possible to rep Finally, statics includes all the `+__+`-methods and thus, anonymous traversals like `+__.out()+` can be expressed as below. That is, without the `+__+`-prefix. -[gremlin-python,modern] +[source,python] ---- -g.V().repeat(out()).times(2).name.fold().toList() +>>> g.V().repeat(out()).times(2).name.fold().toList() +[['ripple', 'lop']] ---- - [[python-configuration]] + anchor:python-configuration[] + [[gremlin-python-configuration]] === Configuration The following table describes the various configuration options for the Gremlin-Python Driver. They @@@ -809,16 -828,63 +820,17 @@@ Finally, Gremlin `Bytecode` that includ engine to to cache traversals that will be reused over and over again save that some parameterization may change. Thus, instead of translating, compiling, and then executing each submitted bytecode, it is possible to simply execute. -[gremlin-python,modern] +[source,python] ---- -g.V(Bindings.of('id',1)).out('created').map(lambda: ("it.get().value('name').length()", "gremlin-groovy")).sum().toList() -g.V(Bindings.of('id',4)).out('created').map(lambda: ("it.get().value('name').length()", "gremlin-groovy")).sum().toList() +>>> g.V(Bindings.of('x',1)).out('created').map(lambda: "it.get().value('name').length()").sum().toList() +[3] +>>> g.V(Bindings.of('x',4)).out('created').map(lambda: "it.get().value('name').length()").sum().toList() +[9] ---- -==== Native Python Lambdas - -To process lambdas in Python, the `GremlinJythonScriptEngine` must be enabled on the remote end. If that remote is -Gremlin Server, then these instructions can help configuration it. As an example, the -`conf/gremlin-server-modern-py.yaml` configuration maintains a `GremlinJythonScriptEngine`. - -[source,bash] ----- -$ bin/gremlin-server.sh install org.apache.tinkerpop gremlin-python x.y.z -$ bin/gremlin-server.sh conf/gremlin-server-modern-py.yaml -[INFO] GremlinServer - - \,,,/ - (o o) ----oOOo-(3)-oOOo--- - -[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern-py.yaml -[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics -[INFO] GraphManager - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties]. -[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* -[INFO] ScriptEngines - Loaded gremlin-jython ScriptEngine -[INFO] ScriptEngines - Loaded gremlin-python ScriptEngine -[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine -[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy -[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines. -[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard] -[INFO] OpLoader - Adding the standard OpProcessor. -[INFO] OpLoader - Adding the session OpProcessor. -[INFO] OpLoader - Adding the traversal OpProcessor. -[INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms -[INFO] GremlinServer - Executing start up LifeCycleHook -[INFO] Logger$info - Loading 'modern' graph data. -[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated. -[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 -[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated. -[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 -[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 -[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 -[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 -[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0-stringd with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 -[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1. -[INFO] GremlinServer$1 - Channel started at port 8182. ----- - -NOTE: The command to use `install` need only be executed once to gather `gremlin-python` dependencies into Gremlin Servers' -path. Future starts of Gremlin Server will not require that command. - -WARNING: As explained throughout the documentation, when possible <> lambdas. If lambdas -must be used, then consider submitting Groovy lambdas as opposed to Python-based ones. The `GremlinGroovyScriptEngine` -is far more featured and performant than its Jython sibling and will likely yield better results. +WARNING: As explained throughout the documentation, when possible <> lambdas. + [[gremlin-python-scripts]] === Submitting Scripts WARNING: TinkerPop does not recommend submitting script-based requests and generally continues to support this feature @@@ -1225,26 -1296,8 +1247,27 @@@ must be written as g.V().Repeat(__.Out()).Times(2).Values("name"); ---- +Gremlin allows for `Map` instances to include `null` keys, but `null` keys in C# `Dictionary` instances are not allowed. +It is therefore necessary to rewrite a traversal such as: + +[source,javascript] +---- +g.V().groupCount().by('age') +---- + +where "age" is not a valid key for all vertices in a way that will remove the need for a `null` to be returned. + +[source,javascript] +---- +g.V().has('age').groupCount().by('age') +g.V().hasLabel('person').groupCount().by('age') +---- + +Either of the above two options accomplishes the desired goal as both prevent `groupCount()` from having to process +the possibility of `null`. + - [[gremlin-net-limitations]] + anchor:gremlin-net-limitations[] + [[gremlin-dotnet-limitations]] === Limitations * The `subgraph()`-step is not supported by any variant that is not running on the Java Virtual Machine as there is