You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2018/08/31 17:33:55 UTC

[2/5] tinkerpop git commit: Add Gremlin.Net driver settings docs TINKERPOP-1774

Add Gremlin.Net driver settings docs TINKERPOP-1774


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c5873566
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c5873566
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c5873566

Branch: refs/heads/TINKERPOP-1774
Commit: c58735661d98889423d7076528b06eb649b73cc1
Parents: 0b9ed2a
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Thu Aug 2 18:45:49 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Fri Aug 31 19:02:24 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  2 +-
 docs/src/dev/provider/index.asciidoc            |  4 +-
 .../src/reference/gremlin-applications.asciidoc |  1 +
 docs/src/reference/gremlin-variants.asciidoc    | 45 +++++++++++++++++++-
 docs/src/upgrade/release-3.4.x.asciidoc         |  4 +-
 .../Driver/ConnectionPoolSettings.cs            |  2 +-
 .../src/Gremlin.Net/Driver/GremlinServer.cs     |  3 +-
 7 files changed, 53 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index acdfe79..ee54f14 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,7 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 This release also includes changes from <<release-3-3-3, 3.3.3>>.
 
-* Added min and max connection pool sizes for Gremlin.Net which are configurable through optional ConnectionPoolSettings.
+* Added min and max connection pool sizes for Gremlin.Net which are configurable through optional `ConnectionPoolSettings`.
 * Implemented `ShortestPathVertexProgram` and the `shortestPath()` step.
 * `AbstractGraphProvider` uses `g.io()` for loading test data.
 * Added the `io()` start step and `read()` and `write()` termination steps to the Gremlin language.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/docs/src/dev/provider/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc
index 49bc7c7..4434cf7 100644
--- a/docs/src/dev/provider/index.asciidoc
+++ b/docs/src/dev/provider/index.asciidoc
@@ -572,9 +572,9 @@ internal class MyTypeReader : IGraphSONDeserializer
     }
 }
 
-var graphsonReader = new GraphSONReader(
+var graphsonReader = new GraphSON3Reader(
     new Dictionary<string, IGraphSONDeserializer> {{MyType.GraphsonType, new MyTypeReader()}});
-var graphsonWriter = new GraphSONWriter(
+var graphsonWriter = new GraphSON3Writer(
     new Dictionary<Type, IGraphSONSerializer> {{typeof(MyType), new MyClassWriter()}});
 
 var gremlinClient = new GremlinClient(new GremlinServer("localhost", 8182), graphsonReader, graphsonWriter);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 234bf3f..04f0502 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1308,6 +1308,7 @@ Gremlin-Console |PLAIN SASL (username/password) |3.0.0-incubating
 |Pluggable SASL |3.0.0-incubating
 |GSSAPI SASL (Kerberos) |3.3.0
 |Gremlin-Python |PLAIN SASL |3.2.2
+|Gremlin.Net |PLAIN SASL |3.2.7
 |Gremlin-Javascript |PLAIN SASL |3.3.0
 |=========================================================
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index 8699b30..363f117 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -342,7 +342,8 @@ A traversal source can be spawned with `RemoteStrategy` from an empty `Graph`.
 [source,csharp]
 ----
 var graph = new Graph();
-var g = graph.Traversal().WithRemote(new DriverRemoteConnection(new GremlinClient(new GremlinServer("localhost", 8182))));
+var remoteConnection = new DriverRemoteConnection(new GremlinClient(new GremlinServer("localhost", 8182)));
+var g = graph.Traversal().WithRemote(remoteConnection);
 ----
 
 When a traversal from the `GraphTraversalSource` is iterated, the traversal’s `Bytecode` is sent over the wire via the registered
@@ -366,6 +367,48 @@ terminal/action methods off of `ITraversal`.
 * `ITraversal.ToSet()`
 * `ITraversal.Iterate()`
 
+=== Configuration
+
+The following sections describe how the Gremlin.Net driver can be configured.
+
+==== Gremlin Server
+
+The connection properties for the Gremlin.Net driver can be passed to the `GremlinServer` instance as keyword arguments:
+
+[width="100%",cols="3,10,^2",options="header"]
+|=========================================================
+|Key |Description |Default
+|hostname |The hostname that the driver will connect to. |localhost
+|port |The port on which Gremlin Server can be reached. |8182
+|enableSsl |Determines if SSL should be enabled or not. If enabled on the server then it must be enabled on the client. |false
+|username |The username to submit on requests that require authentication. |_none_
+|password |The password to submit on requests that require authentication. |_none_
+|=========================================================
+
+==== Connection Pool
+
+It is also possible to configure the `ConnectionPool` of the Gremlin.Net driver. These configuration options can be set as properties
+on the `ConnectionPoolSettings` instance that can be passed to the `GremlinClient`:
+
+[width="100%",cols="3,10,^2",options="header"]
+|=========================================================
+|Key |Description |Default
+|MinSize |The minimum size of the connection pool. This determines how many connections are initially created. |8
+|MaxSize |The maximum size of the connection pool. |128
+|WaitForConnectionTimeout |The timespan to wait for a connection when the maximum size is reached before timing out. A `TimeoutException` is thrown when no connection becomes available until this timeout is reached. |3 seconds.
+|=========================================================
+
+==== GraphSON Serialization
+
+The Gremlin.Net driver uses by default GraphSON 3.0 but it is also possible to use GraphSON 2.0 which can be necessary
+when the server does not support GraphSON 3.0 yet:
+
+[source,csharp]
+----
+var client = new GremlinClient(new GremlinServer("localhost", 8182), new GraphSON2Reader(),
+    new GraphSON2Writer(), GremlinClient.GraphSON2MimeType);
+----
+
 === Static Enums and Methods
 
 Gremlin has various tokens (e.g. `T`, `P`, `Order`, `Operator`, etc.) that are represented in Gremlin.Net as classes.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/docs/src/upgrade/release-3.4.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc
index 33fe5dd..19611af 100644
--- a/docs/src/upgrade/release-3.4.x.asciidoc
+++ b/docs/src/upgrade/release-3.4.x.asciidoc
@@ -242,9 +242,9 @@ when dealing with that event. To make this easier, the event now raises with a `
 
 link:https://issues.apache.org/jira/browse/TINKERPOP-1831[TINKERPOP-1831]
 
-==== Gremlin.Net: Configurable Max and Min ConnectionPool Sizes
+==== Gremlin.Net Connection Pool
 
-Gremlin.Net's `ConnectionPool` now has a minimum and a maximum size. These sizes are configurable through added
+Gremlin.Net's `ConnectionPool` now has a minimum and a maximum size. These sizes are configurable through the newly added
 `ConnectionPoolSettings`. The minimum size determines how many connections are initially created. The maximum size
 is an upper limit of connections that can be created. When this limit is reached and another connection is needed,
 then the connection pool waits for a connection to become available again. The time to be waited is limited by the

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPoolSettings.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPoolSettings.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPoolSettings.cs
index b156137..82b5edd 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPoolSettings.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionPoolSettings.cs
@@ -47,7 +47,7 @@ namespace Gremlin.Net.Driver
         public int MaxSize { get; set; } = DefaultMaxPoolSize;
 
         /// <summary>
-        ///     Gets or sets the timespan to wait for a new connection before timing out.
+        ///     Gets or sets the timespan to wait for a connection to become available before timing out.
         /// </summary>
         /// <remarks>The default value is 3 seconds.</remarks>
         public TimeSpan WaitForConnectionTimeout { get; set; } = DefaultWaitForConnectionTimeout;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c5873566/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinServer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinServer.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinServer.cs
index 601bbae..43ef159 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinServer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/GremlinServer.cs
@@ -38,7 +38,8 @@ namespace Gremlin.Net.Driver
         /// <param name="enableSsl">Specifies whether SSL should be enabled.</param>
         /// <param name="username">The username to submit on requests that require authentication.</param>
         /// <param name="password">The password to submit on requests that require authentication.</param>
-        public GremlinServer(string hostname, int port = 8182, bool enableSsl = false, string username = null, string password = null)
+        public GremlinServer(string hostname = "localhost", int port = 8182, bool enableSsl = false,
+            string username = null, string password = null)
         {
             Uri = CreateUri(hostname, port, enableSsl);
             Username = username;