Repository: tinkerpop Updated Branches: refs/heads/master 20c5f8493 -> d1ebe5fcf
TINKERPOP-1460 Deprecate reconnectInitialDelay on Java driver The deprecated setting is one of the less impactful ones and should be of little concern to users insofar as affecting driver performnance or usage. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d1ebe5fc Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d1ebe5fc Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d1ebe5fc Branch: refs/heads/master Commit: d1ebe5fcf935f4f7020a44e158a56b1591005913 Parents: 20c5f84 Author: Stephen Mallette <[email protected]> Authored: Thu Sep 29 12:26:56 2016 -0400 Committer: Stephen Mallette <[email protected]> Committed: Thu Sep 29 12:26:56 2016 -0400 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 1 + docs/src/upgrade/release-3.2.x-incubating.asciidoc | 9 +++++++++ .../java/org/apache/tinkerpop/gremlin/driver/Cluster.java | 3 +++ .../org/apache/tinkerpop/gremlin/driver/Connection.java | 5 +++++ .../main/java/org/apache/tinkerpop/gremlin/driver/Host.java | 2 +- 5 files changed, 19 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d1ebe5fc/CHANGELOG.asciidoc ---------------------------------------------------------------------- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 47d4bbf..cced503 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -55,6 +55,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET) * Added "keep-alive" functionality to the Java driver, which will send a heartbeat to the server when normal request activity on a connection stops for a period of time. * Renamed the `empty.result.indicator` preference to `result.indicator.null` in Gremlin Console * If `result.indicator.null` is set to an empty string, then no "result line" is printed in Gremlin Console. +* Deprecated `reconnectInitialDelay` on the Java driver. * VertexPrograms can now declare traverser requirements, e.g. to have access to the path when used with `.program()`. * New build options for `gremlin-python` where `-DglvPython` is no longer required. * Added missing `InetAddress` to GraphSON extension module. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d1ebe5fc/docs/src/upgrade/release-3.2.x-incubating.asciidoc ---------------------------------------------------------------------- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index a6be1c6..cc1cf2e 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -118,6 +118,15 @@ gremlin> g.V().hasLabel("software").count() TinkerPop 3.2.3 fixes this misbehavior and all `has()` method overloads behave like before, except that they no longer support no arguments. +Deprecated reconnectInitialDelay +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The `reconnectInitialDelay` setting on the `Cluster` builder has been deprecated. It no longer serves any purpose. +The value for the "initial delay" now comes from `reconnectInterval` (there are no longer two separate settings to +control). + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1460[TINKERPOP-1460] + Upgrading for Providers ~~~~~~~~~~~~~~~~~~~~~~~ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d1ebe5fc/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 f79e719..f420de0 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 @@ -732,7 +732,10 @@ public final class Cluster { /** * 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; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d1ebe5fc/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 1ef9b98..02ec0b3 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 @@ -63,6 +63,11 @@ final class Connection { 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; + + /** + * @deprecated As of release 3.2.3, replaced by {@link #RECONNECT_INTERVAL}. + */ + @Deprecated public static final int RECONNECT_INITIAL_DELAY = 1000; public static final int RECONNECT_INTERVAL = 1000; public static final int RESULT_ITERATION_BATCH_SIZE = 64; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d1ebe5fc/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Host.java ---------------------------------------------------------------------- diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Host.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Host.java index e21d9be..52f4d78 100644 --- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Host.java +++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Host.java @@ -76,7 +76,7 @@ public final class Host { retryThread = this.cluster.executor().scheduleAtFixedRate(() -> { logger.debug("Trying to reconnect to dead host at {}", this); if (reconnect.apply(this)) reconnected(); - }, cluster.connectionPoolSettings().reconnectInitialDelay, + }, cluster.connectionPoolSettings().reconnectInterval, cluster.connectionPoolSettings().reconnectInterval, TimeUnit.MILLISECONDS); } }
