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/02/13 13:30:49 UTC

[02/37] incubator-tinkerpop git commit: Use the existing Host iterator

Use the existing Host iterator

TINKERPOP-1125
Rather than creating a new iterator so skipping over a host in the pool.


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

Branch: refs/heads/master
Commit: c5b242126131edbe7e87300fc34a54a4dcb9fce9
Parents: 93f430e
Author: Kieran Sherlock <ki...@identitymind.com>
Authored: Fri Feb 5 06:25:32 2016 -0800
Committer: Kieran Sherlock <ki...@identitymind.com>
Committed: Fri Feb 5 06:25:32 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c5b24212/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 8c80b8a..17c9a99 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
@@ -341,7 +341,7 @@ public abstract class Client {
             final Iterator<Host> possibleHosts = this.cluster.loadBalancingStrategy().select(msg);
             if (!possibleHosts.hasNext()) throw new TimeoutException("Timed out waiting for an available host.");
 
-            final Host bestHost = this.cluster.loadBalancingStrategy().select(msg).next();
+            final Host bestHost = possibleHosts.next();
             final ConnectionPool pool = hostConnectionPools.get(bestHost);
             return pool.borrowConnection(cluster.connectionPoolSettings().maxWaitForConnection, TimeUnit.MILLISECONDS);
         }