Merge branch 'tp32' into tp33 Conflicts: gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/650d1e84 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/650d1e84 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/650d1e84 Branch: refs/heads/master Commit: 650d1e84d0b7d6f8a213a67df593c43134e156fe Parents: 2b4c993 b510613 Author: Stephen Mallette <sp...@genoprime.com> Authored: Thu Oct 4 12:11:28 2018 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Thu Oct 4 12:11:28 2018 -0400 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 1 + .../src/reference/gremlin-applications.asciidoc | 1 + .../tinkerpop/gremlin/driver/Cluster.java | 30 ++++++++++++++++++-- .../gremlin/driver/ConnectionPool.java | 3 +- .../tinkerpop/gremlin/driver/Settings.java | 15 +++++++--- .../tinkerpop/gremlin/driver/SettingsTest.java | 8 ++++-- .../server/GremlinDriverIntegrateTest.java | 27 +++++++++++++++++- 7 files changed, 74 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/CHANGELOG.asciidoc ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/docs/src/reference/gremlin-applications.asciidoc ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java ---------------------------------------------------------------------- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java index cee1309,c090584..fe1d896 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java @@@ -880,6 -900,28 +891,17 @@@ public final class Cluster } /** + * Specify a valid Gremlin script that can be used to test remote operations. This script should be designed + * to return quickly with the least amount of overhead possible. By default, the script sends an empty string. + * If the graph does not support that sort of script because it requires all scripts to include a reference + * to a graph then a good option might be {@code g.inject()}. + */ + public Builder validationRequest(final String script) { + validationRequest = script; + return this; + } + + /** - * Time in milliseconds to wait before attempting to reconnect to a dead host after it has been marked dead. - * - * @deprecated As of release 3.2.3, the value of the initial delay is now the same as the {@link #reconnectInterval}. - */ - @Deprecated - public Builder reconnectIntialDelay(final int initialDelay) { - this.reconnectInitialDelay = initialDelay; - return this; - } - - /** * Time in milliseconds to wait between retries when attempting to reconnect to a dead host. */ public Builder reconnectInterval(final int interval) { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java ---------------------------------------------------------------------- diff --cc gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java index 37cecb4,c2ae045..61edd86 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Settings.java @@@ -409,6 -420,27 +411,11 @@@ final class Settings * {@link org.apache.tinkerpop.gremlin.driver.Channelizer.WebSocketChannelizer}. */ public String channelizer = Channelizer.WebSocketChannelizer.class.getName(); + + /** + * A valid Gremlin script that can be used to test remote operations. + */ + public String validationRequest = "''"; - - /** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ - @Deprecated - public String sessionId = null; - - /** - * @deprecated as of 3.1.1-incubating, and not replaced as this property was never implemented internally - * as the way to establish sessions - */ - @Deprecated - public Optional<String> optionalSessionId() { - return Optional.ofNullable(sessionId); - } } public static class SerializerSettings { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java ---------------------------------------------------------------------- diff --cc gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java index 4ef0692,63c4308..c140f04 --- a/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java +++ b/gremlin-driver/src/test/java/org/apache/tinkerpop/gremlin/driver/SettingsTest.java @@@ -66,8 -68,10 +68,9 @@@ public class SettingsTest conf.setProperty("connectionPool.maxWaitForConnection", 700); conf.setProperty("connectionPool.maxContentLength", 800); conf.setProperty("connectionPool.reconnectInterval", 900); - conf.setProperty("connectionPool.reconnectInitialDelay", 1000); conf.setProperty("connectionPool.resultIterationBatchSize", 1100); conf.setProperty("connectionPool.channelizer", "channelizer0"); + conf.setProperty("connectionPool.validationRequest", "g.inject()"); final Settings settings = Settings.from(conf); @@@ -103,7 -107,9 +106,8 @@@ assertEquals(700, settings.connectionPool.maxWaitForConnection); assertEquals(800, settings.connectionPool.maxContentLength); assertEquals(900, settings.connectionPool.reconnectInterval); - assertEquals(1000, settings.connectionPool.reconnectInitialDelay); assertEquals(1100, settings.connectionPool.resultIterationBatchSize); assertEquals("channelizer0", settings.connectionPool.channelizer); + assertEquals("g.inject()", settings.connectionPool.validationRequest); } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/650d1e84/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java ----------------------------------------------------------------------