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/08/29 16:46:42 UTC

[1/3] tinkerpop git commit: Throw a proper exception when no available host

Repository: tinkerpop
Updated Branches:
  refs/heads/tp31 8912f79c1 -> f0ab088b6


Throw a proper exception when no available host

When a SessionedClient is initialized and no host is available in the cluster,
A proper exception is thrown instead of an IndexOutOfBoundsException


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

Branch: refs/heads/tp31
Commit: 1b45e2ab603bbe11f2777ce94452fe452209c268
Parents: 8912f79
Author: davidclement90 <da...@laposte.net>
Authored: Mon Aug 29 11:30:49 2016 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 29 12:24:52 2016 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java   | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1b45e2ab/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 a8b1710..4908d0e 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
@@ -521,6 +521,7 @@ public abstract class Client {
             final List<Host> hosts = cluster.allHosts()
                     .stream().filter(Host::isAvailable).collect(Collectors.toList());
             Collections.shuffle(hosts);
+            if (hosts.isEmpty()) throw new IllegalStateException("No available host in the cluster");
             final Host host = hosts.get(0);
             connectionPool = new ConnectionPool(host, this, Optional.of(1), Optional.of(1));
         }


[2/3] tinkerpop git commit: Check if hosts are empty first before bothering to do a shuffle to choose one at random. CTR

Posted by sp...@apache.org.
Check if hosts are empty first before bothering to do a shuffle to choose one at random. CTR


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

Branch: refs/heads/tp31
Commit: 1a2d3234620b2822f417275c5eb8b525bf88a5d6
Parents: 1b45e2a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 29 12:43:38 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 29 12:43:38 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                                 | 1 +
 .../src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a2d3234/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index afb2a7f..8fe87a9 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.1.4 (NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Improved the error provided by a client-side session if no hosts were available.
 * Fixed a bug in `PropertiesTest` which assumed long id values.
 * Fixed a bug in `StarGraph` around self-edges.
 * Fixed a potential leak of a `ReferenceCounted` resource in Gremlin Server.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a2d3234/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 4908d0e..4aca9ca 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
@@ -520,8 +520,8 @@ public abstract class Client {
             // chooses an available host at random
             final List<Host> hosts = cluster.allHosts()
                     .stream().filter(Host::isAvailable).collect(Collectors.toList());
-            Collections.shuffle(hosts);
             if (hosts.isEmpty()) throw new IllegalStateException("No available host in the cluster");
+            Collections.shuffle(hosts);
             final Host host = hosts.get(0);
             connectionPool = new ConnectionPool(host, this, Optional.of(1), Optional.of(1));
         }


[3/3] tinkerpop git commit: Fixed link to point at current contributing guide. CTR

Posted by sp...@apache.org.
Fixed link to point at current contributing guide. CTR


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

Branch: refs/heads/tp31
Commit: f0ab088b611f487f4e8a27dfb765f81f23c0712e
Parents: 1a2d323
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 29 12:46:10 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 29 12:46:10 2016 -0400

----------------------------------------------------------------------
 CONTRIBUTING.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f0ab088b/CONTRIBUTING.asciidoc
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.asciidoc b/CONTRIBUTING.asciidoc
index f209a0e..0739c73 100644
--- a/CONTRIBUTING.asciidoc
+++ b/CONTRIBUTING.asciidoc
@@ -23,4 +23,4 @@ you agree to license the material under the project's open source license and
 warrant that you have the legal authority to do so.
 
 Please see the "Developer Documentation" for more information on
-link:http://tinkerpop.apache.org/docs/3.1.0-SNAPSHOT/developer.html#_contributing[contributing] to TinkerPop.
\ No newline at end of file
+link:http://tinkerpop.apache.org/docs/current/dev/developer/#_contributing[contributing] to TinkerPop.
\ No newline at end of file