You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/03/02 23:19:37 UTC
[1/7] incubator-tinkerpop git commit: Minor change to variable
definition.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1160 [created] 5944ee657
Minor change to variable definition.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/4247aa62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/4247aa62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/4247aa62
Branch: refs/heads/TINKERPOP-1160
Commit: 4247aa6275a0dfdbef0d8d5c222806d3d3bf4d69
Parents: 8a2d797
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 14:51:34 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 14:51:34 2016 -0500
----------------------------------------------------------------------
.../main/java/org/apache/tinkerpop/gremlin/server/Settings.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4247aa62/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index e97a45e..a6f59cd 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -102,13 +102,13 @@ public class Settings {
/**
* Time in milliseconds to wait for a script to complete execution. Defaults to 30000.
*/
- public long scriptEvaluationTimeout = 30000l;
+ public long scriptEvaluationTimeout = 30000L;
/**
* Time in milliseconds to wait while an evaluated script serializes its results. This value represents the
* total serialization time for the request. Defaults to 30000.
*/
- public long serializedResponseTimeout = 30000l;
+ public long serializedResponseTimeout = 30000L;
/**
* Number of items in a particular resultset to iterate and serialize prior to pushing the data down the wire
[6/7] incubator-tinkerpop git commit: Allowed maxWaitForSessionClose
to get assigned from the Cluster builder.
Posted by sp...@apache.org.
Allowed maxWaitForSessionClose to get assigned from the Cluster builder.
This setting was defined through Settings but were not passed along to the Cluster builder.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/7ebd46cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/7ebd46cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/7ebd46cd
Branch: refs/heads/TINKERPOP-1160
Commit: 7ebd46cd5fc78e6ce0e6ea58ba1d2cb999284c10
Parents: d07eb59
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 16:34:14 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 16:34:14 2016 -0500
----------------------------------------------------------------------
.../org/apache/tinkerpop/gremlin/driver/Cluster.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7ebd46cd/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index b29cc95..02181e2 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -278,6 +278,7 @@ public final class Cluster {
private int maxInProcessPerConnection = Connection.MAX_IN_PROCESS;
private int minInProcessPerConnection = Connection.MIN_IN_PROCESS;
private int maxWaitForConnection = Connection.MAX_WAIT_FOR_CONNECTION;
+ private int maxWaitForSessionClose = Connection.MAX_WAIT_FOR_SESSION_CLOSE;
private int maxContentLength = Connection.MAX_CONTENT_LENGTH;
private int reconnectInitialDelay = Connection.RECONNECT_INITIAL_DELAY;
private int reconnectInterval = Connection.RECONNECT_INTERVAL;
@@ -442,6 +443,16 @@ public final class Cluster {
}
/**
+ * If the connection is using a "session" this setting represents the amount of time in milliseconds to wait
+ * for that session to close before timing out where the default value is 3000. Note that the server will
+ * eventually clean up dead sessions itself on expiration of the session or during shutdown.
+ */
+ public Builder maxWaitForSessionClose(final int maxWait) {
+ this.maxWaitForSessionClose = maxWait;
+ return this;
+ }
+
+ /**
* The maximum size in bytes of any request sent to the server. This number should not exceed the same
* setting defined on the server.
*/
@@ -569,6 +580,7 @@ public final class Cluster {
connectionPoolSettings.maxSize = this.maxConnectionPoolSize;
connectionPoolSettings.minSize = this.minConnectionPoolSize;
connectionPoolSettings.maxWaitForConnection = this.maxWaitForConnection;
+ connectionPoolSettings.maxWaitForSessionClose = this.maxWaitForSessionClose;
connectionPoolSettings.maxContentLength = this.maxContentLength;
connectionPoolSettings.reconnectInitialDelay = this.reconnectInitialDelay;
connectionPoolSettings.reconnectInterval = this.reconnectInterval;
[3/7] incubator-tinkerpop git commit: Update changelog.
Posted by sp...@apache.org.
Update changelog.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f0fc5e27
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f0fc5e27
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f0fc5e27
Branch: refs/heads/TINKERPOP-1160
Commit: f0fc5e27ba8248396919c6175abff55f9496978c
Parents: 29b0525
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 15:50:31 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 15:50:31 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f0fc5e27/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 009b69b..6987b2e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Added `maxWaitForSessionClose` to the settings for Gremlin Driver.
* Bumped to Netty 4.0.34.Final.
* Added "interpreter mode" for the `ScriptEngine` and Gremlin Server which allows variables defined with `def` or a type to be recognized as "global".
* Bumped to Apache Groovy 2.4.6.
[4/7] incubator-tinkerpop git commit: Update upgrade docs around
TINKERPOP-1160
Posted by sp...@apache.org.
Update upgrade docs around TINKERPOP-1160
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/90b3117b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/90b3117b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/90b3117b
Branch: refs/heads/TINKERPOP-1160
Commit: 90b3117b29933741e0a4f29ec38abfb15f35bcb3
Parents: f0fc5e2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 15:53:28 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 15:53:28 2016 -0500
----------------------------------------------------------------------
docs/src/upgrade/release-3.1.x-incubating.asciidoc | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/90b3117b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.1.x-incubating.asciidoc b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
index ab0d725..2652d03 100644
--- a/docs/src/upgrade/release-3.1.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
@@ -63,6 +63,15 @@ in a transaction. With this configuration of `client` there is no need to close
See: link:https://issues.apache.org/jira/browse/TINKERPOP-1039[TINKERPOP-1039],
link:http://tinkerpop.apache.org/docs/3.1.2-incubating/reference/#sessions[Reference Documentation - Considering Sessions]
+Session Timeout Setting
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The `gremlin-driver` now has a setting called `maxWaitForSessionClose` that allows control of how long it will wait for
+an in-session connection to respond to a close request before it simply times-out and moves on. When that happens,
+the server will either eventually close the connection via at session expiration or at the time of shutdown.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1160[TINKERPOP-1160]
+
Upgrading for Providers
~~~~~~~~~~~~~~~~~~~~~~~
[7/7] incubator-tinkerpop git commit: Add reference docs for all the
driver settings.
Posted by sp...@apache.org.
Add reference docs for all the driver settings.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5944ee65
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5944ee65
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5944ee65
Branch: refs/heads/TINKERPOP-1160
Commit: 5944ee6574b0feb9d2b257768d0dc3a1309697dd
Parents: 7ebd46c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 17:16:15 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 17:16:15 2016 -0500
----------------------------------------------------------------------
.../src/reference/gremlin-applications.asciidoc | 39 +++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5944ee65/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index b7c8ac0..9810acd 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -532,6 +532,43 @@ In this case, they are streamed from the server as they arrive.
<5> Parameterized request are considered the most efficient way to send Gremlin to the server as they can be cached,
which will boost performance and reduce resources required on the server.
+Configuration
+^^^^^^^^^^^^^
+
+The following table describes the various configuration options for the Gremlin Driver:
+
+[width="100%",cols="3,10,^2",options="header"]
+|=========================================================
+|Key |Description |Default
+|connectionPool.channelizer |The fully qualified classname of the client `Channelizer` that defines how to connect to the server. |`Channelizer.WebSocketChannelizer`
+|connectionPool.enableSsl |Determines if SSL should be enabled or not. If enabled on the server then it must be enabled on the client. |false
+|connectionPool.maxContentLength |The maximum length in bytes that a message can be sent to the server. This number can be no greater than the setting of the same name in the server configuration. |65536
+|connectionPool.maxInProcessPerConnection |The maximum number of in-flight requests that can occur on a connection. |4
+|connectionPool.maxSimultaneousUsagePerConnection |The maximum number of times that a connection can be borrowed from the pool simultaneously. |16
+|connectionPool.maxSize |The maximum size of a connection pool for a host. |8
+|connectionPool.maxWaitForConnection |The amount of time in milliseconds to wait for a new connection before timing out. |3000
+|connectionPool.maxWaitForSessionClose |The amount of time in milliseconds to wait for a session to close before timing out (does not apply to sessionless connections). |3000
+|connectionPool.minInProcessPerConnection |The minimum number of in-flight requests that can occur on a connection. |1
+|connectionPool.minSimultaneousUsagePerConnection |The maximum number of times that a connection can be borrowed from the pool simultaneously. |8
+|connectionPool.minSize |The minimum size of a connection pool for a host. |2
+|connectionPool.reconnectInitialDelay |The amount of time in milliseconds to wait before trying to reconnect to a dead host for the first time. |1000
+|connectionPool.reconnectInterval |The amount of time in milliseconds to wait before trying to reconnect to a dead host. This interval occurs after the time specified by the `reconnectInitialDelay`. |1000
+|connectionPool.resultIterationBatchSize |The override value for the size of the result batches to be returned from the server. |64
+|connectionPool.trustCertChainFile |File location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the `TrustManager` will be established with a self-signed certificate which is NOT suitable for production purposes. |_none_
+|hosts |The list of hosts that the driver will connect to. |localhost
+|jaasEntry |Sets the `AuthProperties.Property.JAAS_ENTRY` properties for authentication to Gremlin Server. |_none_
+|nioPoolSize |Size of the pool for handling request/response operations. |available processors
+|password |The password to submit on requests that require authentication. |_none_
+|port |The port of the Gremlin Server to connect to. The same port will be applied for all hosts. |8192
+|protocol |Sets the `AuthProperties.Property.PROTOCOL` properties for authentication to Gremlin Server. |_none_
+|serializer.className |The fully qualified class name of the `MessageSerializer` that will be used to communicate with the server. Note that the serializer configured on the client should be supported by the server configuration. |`GryoMessageSerializerV1d0`
+|serializer.config |A `Map` of configuration settings for the serializer. |_none_
+|username |The username to submit on requests that require authentication. |_none_
+|workerPoolSize |Size of the pool for handling background work. |available processors * 2
+|=========================================================
+
+Please see the link:http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/driver/Cluster.Builder.html[Cluster.Builder javadoc] to get more information on these settings.
+
Aliases
^^^^^^^
@@ -693,7 +730,7 @@ The following table describes the various configuration options that Gremlin Ser
|Key |Description |Default
|authentication.className |The fully qualified classname of an `Authenticator` implementation to use. If this setting is not present, then authentication is effectively disabled. |`AllowAllAuthenticator`
|authentication.config |A `Map` of configuration settings to be passes to the `Authenticator` when it is constructed. The settings available are dependent on the implementation. |_none_
-|channelizer |The fully qualified classname of the `Channelizer` implementation to use. A `Channelizer` is a "channel initializer" which Gremlin Server uses to define the type of processing pipeline to use. By allowing different `Channelizer` implementations, Gremlin Server can support different communication protocols (e.g. Websockets, Java NIO, etc.). |WebSocketChannelizer
+|channelizer |The fully qualified classname of the `Channelizer` implementation to use. A `Channelizer` is a "channel initializer" which Gremlin Server uses to define the type of processing pipeline to use. By allowing different `Channelizer` implementations, Gremlin Server can support different communication protocols (e.g. Websockets, Java NIO, etc.). |`WebSocketChannelizer`
|graphs |A `Map` of `Graph` configuration files where the key of the `Map` becomes the name to which the `Graph` will be bound and the value is the file name of a `Graph` configuration file. |_none_
|gremlinPool |The number of "Gremlin" threads available to execute actual scripts in a `ScriptEngine`. This pool represents the workers available to handle blocking operations in Gremlin Server. |8
|host |The name of the host to bind the server to. |localhost
[2/7] incubator-tinkerpop git commit: Added maxWaitForSessionClose to
driver configuration.
Posted by sp...@apache.org.
Added maxWaitForSessionClose to driver configuration.
This setting configures how long the driver will wait to kill a session before it just lets the server handle it. Added a bunch of javadoc to the driver settings.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/29b05259
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/29b05259
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/29b05259
Branch: refs/heads/TINKERPOP-1160
Commit: 29b052598ecc90296a810b3a8fdb525afbabeb6d
Parents: 4247aa6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 15:48:52 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 15:48:52 2016 -0500
----------------------------------------------------------------------
.../apache/tinkerpop/gremlin/driver/Client.java | 1 -
.../tinkerpop/gremlin/driver/Connection.java | 14 ++-
.../tinkerpop/gremlin/driver/Settings.java | 116 +++++++++++++++++++
3 files changed, 127 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/29b05259/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
index 031d595..50de9d8 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java
@@ -22,7 +22,6 @@ import org.apache.tinkerpop.gremlin.driver.exception.ConnectionException;
import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/29b05259/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
index cb26781..a3b8ff3 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
@@ -33,6 +33,8 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@@ -55,6 +57,7 @@ final class Connection {
public static final int MAX_IN_PROCESS = 4;
public static final int MIN_IN_PROCESS = 1;
public static final int MAX_WAIT_FOR_CONNECTION = 3000;
+ public static final int MAX_WAIT_FOR_SESSION_CLOSE = 3000;
public static final int MAX_CONTENT_LENGTH = 65536;
public static final int RECONNECT_INITIAL_DELAY = 1000;
public static final int RECONNECT_INTERVAL = 1000;
@@ -215,7 +218,7 @@ final class Connection {
private void shutdown(final CompletableFuture<Void> future) {
// shutdown can be called directly from closeAsync() or after write() and therefore this method should only
- // be called once. once shutdown is initiated, it shoudln't be executed a second time or else it sends more
+ // be called once. once shutdown is initiated, it shouldn't be executed a second time or else it sends more
// messages at the server and leads to ugly log messages over there.
if (shutdownInitiated.compareAndSet(false, true)) {
if (client instanceof Client.SessionedClient) {
@@ -228,10 +231,15 @@ final class Connection {
// make sure we get a response here to validate that things closed as expected. on error, we'll let
// the server try to clean up on its own. the primary error here should probably be related to
// protocol issues which should not be something a user has to fuss with.
- closed.get();
+ closed.get(cluster.connectionPoolSettings().maxWaitForSessionClose, TimeUnit.MILLISECONDS);
+ } catch (TimeoutException ex) {
+ final String msg = String.format(
+ "Timeout while trying to close connection on %s - force closing - server will close session on shutdown or expiration.",
+ ((Client.SessionedClient) client).getSessionId());
+ logger.warn(msg, ex);
} catch (Exception ex) {
final String msg = String.format(
- "Encountered an error trying to close connection on %s - force closing - server will close session on shutdown or timeout.",
+ "Encountered an error trying to close connection on %s - force closing - server will close session on shutdown or expiration.",
((Client.SessionedClient) client).getSessionId());
logger.warn(msg, ex);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/29b05259/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index 7a40d4f..fb85910 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -31,28 +31,62 @@ import java.util.Objects;
import java.util.Optional;
/**
+ * Settings for the {@link Cluster} and its related components.
+ *
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
final class Settings {
+ /**
+ * The port of the Gremlin Server to connect to which defaults to {@code 8192}. The same port will be applied for
+ * all {@link #hosts}.
+ */
public int port = 8182;
+ /**
+ * The list of hosts that the driver will connect to.
+ */
public List<String> hosts = new ArrayList<>();
+ /**
+ * The serializer that will be used when communicating with the server. Note that serializer settings should match
+ * what is available on the server.
+ */
public SerializerSettings serializer = new SerializerSettings();
+ /**
+ * Settings for connections and connection pool.
+ */
public ConnectionPoolSettings connectionPool = new ConnectionPoolSettings();
+ /**
+ * The size of the thread pool defaulted to the number of available processors.
+ */
public int nioPoolSize = Runtime.getRuntime().availableProcessors();
+ /**
+ * The number of worker threads defaulted to the number of available processors * 2.
+ */
public int workerPoolSize = Runtime.getRuntime().availableProcessors() * 2;
+ /**
+ * The username to submit on requests that require authentication.
+ */
public String username = null;
+ /**
+ * The password to submit on requests that require authentication.
+ */
public String password = null;
+ /**
+ * The JAAS to submit on requests that require authentication.
+ */
public String jaasEntry = null;
+ /**
+ * The JAAS protocol to submit on requests that require authentication.
+ */
public String protocol = null;
/**
@@ -74,19 +108,93 @@ final class Settings {
}
static class ConnectionPoolSettings {
+ /**
+ * Determines if SSL should be enabled or not. If enabled on the server then it must be enabled on the client.
+ */
public boolean enableSsl = false;
+
+ /**
+ * The trusted certificate in PEM format.
+ */
public String trustCertChainFile = null;
+
+ /**
+ * The minimum size of a connection pool for a {@link Host}. By default this is set to 2.
+ */
public int minSize = ConnectionPool.MIN_POOL_SIZE;
+
+ /**
+ * The maximum size of a connection pool for a {@link Host}. By default this is set to 8.
+ */
public int maxSize = ConnectionPool.MAX_POOL_SIZE;
+
+ /**
+ * A connection under low use can be destroyed. This setting determines the threshold for determining when
+ * that connection can be released and is defaulted to 8.
+ */
public int minSimultaneousUsagePerConnection = ConnectionPool.MIN_SIMULTANEOUS_USAGE_PER_CONNECTION;
+
+ /**
+ * If a connection is over used, then it might mean that is necessary to expand the pool by adding a new
+ * connection. This setting determines the threshold for a connections over use and is defaulted to 16
+ */
public int maxSimultaneousUsagePerConnection = ConnectionPool.MAX_SIMULTANEOUS_USAGE_PER_CONNECTION;
+
+ /**
+ * The maximum number of requests in flight on a connection where the default is 4.
+ */
public int maxInProcessPerConnection = Connection.MAX_IN_PROCESS;
+
+ /**
+ * A connection has available in-process requests which is calculated by subtracting the number of current
+ * in-flight requests on a connection and subtracting that from the {@link #maxInProcessPerConnection}. When
+ * that number drops below this configuration setting, the connection is recommended for replacement. The
+ * default for this setting is 1.
+ */
public int minInProcessPerConnection = Connection.MIN_IN_PROCESS;
+
+ /**
+ * The amount of time in milliseconds to wait for a new connection before timing out where the default value
+ * is 3000.
+ */
public int maxWaitForConnection = Connection.MAX_WAIT_FOR_CONNECTION;
+
+ /**
+ * If the connection is using a "session" this setting represents the amount of time in milliseconds to wait
+ * for that session to close before timing out where the default value is 3000. Note that the server will
+ * eventually clean up dead sessions itself on expiration of the session or during shutdown.
+ */
+ public int maxWaitForSessionClose = Connection.MAX_WAIT_FOR_SESSION_CLOSE;
+
+ /**
+ * The maximum length in bytes that a message can be sent to the server. This number can be no greater than
+ * the setting of the same name in the server configuration. The default value is 65536.
+ */
public int maxContentLength = Connection.MAX_CONTENT_LENGTH;
+
+ /**
+ * The amount of time in milliseconds to wait before trying to reconnect to a dead host. The default value is
+ * 1000. This interval occurs after the time specified by the {@link #reconnectInitialDelay}.
+ */
public int reconnectInterval = Connection.RECONNECT_INTERVAL;
+
+ /**
+ * The amount of time in milliseconds to wait before trying to reconnect to a dead host for the first time.
+ * The default value is 1000.
+ */
public int reconnectInitialDelay = Connection.RECONNECT_INITIAL_DELAY;
+
+ /**
+ * The override value for the size of the result batches to be returned from the server. This value is set to
+ * 64 by default.
+ */
public int resultIterationBatchSize = Connection.RESULT_ITERATION_BATCH_SIZE;
+
+ /**
+ * The constructor for the channel that connects to the server. This value should be the fully qualified
+ * class name of a Gremlin Driver {@link Channelizer} implementation. By default this value is set to
+ * {@link org.apache.tinkerpop.gremlin.driver.Channelizer.WebSocketChannelizer}.
+ */
public String channelizer = Channelizer.WebSocketChannelizer.class.getName();
/**
@@ -107,7 +215,15 @@ final class Settings {
}
public static class SerializerSettings {
+ /**
+ * The fully qualified class name of the {@link MessageSerializer} that will be used to communicate with the
+ * server. Note that the serializer configured on the client should be supported by the server configuration.
+ */
public String className = GraphSONMessageSerializerV1d0.class.getCanonicalName();
+
+ /**
+ * The configuration for the specified serializer with the {@link #className}.
+ */
public Map<String, Object> config = null;
public MessageSerializer create() throws Exception {
[5/7] incubator-tinkerpop git commit: The default serializer for
settings was not congruent with Cluster.
Posted by sp...@apache.org.
The default serializer for settings was not congruent with Cluster.
Made the default for Settings to be gryo like Cluster.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/d07eb59b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d07eb59b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d07eb59b
Branch: refs/heads/TINKERPOP-1160
Commit: d07eb59b6633bba3ba27b4a6f26acc5f4ca64c23
Parents: 90b3117
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Mar 2 16:32:46 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 2 16:32:46 2016 -0500
----------------------------------------------------------------------
.../main/java/org/apache/tinkerpop/gremlin/driver/Settings.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d07eb59b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
index fb85910..4daa223 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
@@ -18,7 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.driver;
-import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@@ -219,7 +219,7 @@ final class Settings {
* The fully qualified class name of the {@link MessageSerializer} that will be used to communicate with the
* server. Note that the serializer configured on the client should be supported by the server configuration.
*/
- public String className = GraphSONMessageSerializerV1d0.class.getCanonicalName();
+ public String className = GryoMessageSerializerV1d0.class.getCanonicalName();
/**
* The configuration for the specified serializer with the {@link #className}.