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 2015/06/23 21:51:34 UTC
incubator-tinkerpop git commit: Add some javadoc.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master f909e3571 -> 1707cf2be
Add some javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1707cf2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1707cf2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1707cf2b
Branch: refs/heads/master
Commit: 1707cf2be0d76a1099c2e2132c95a2e7757c79d7
Parents: f909e35
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Jun 23 15:51:23 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Jun 23 15:51:23 2015 -0400
----------------------------------------------------------------------
.../gremlin/driver/LoadBalancingStrategy.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1707cf2b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/LoadBalancingStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/LoadBalancingStrategy.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/LoadBalancingStrategy.java
index d1811aa..e2ced77 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/LoadBalancingStrategy.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/LoadBalancingStrategy.java
@@ -28,13 +28,26 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
/**
+ * Provides a method for selecting the host from a {@link Cluster}.
+ *
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public interface LoadBalancingStrategy extends Host.Listener {
+
+ /**
+ * Initialize the strategy with the {@link Cluster} instance and the expected host list.
+ */
public void initialize(final Cluster cluster, final Collection<Host> hosts);
+ /**
+ * Provide an ordered list of hosts to send the the given {@link RequestMessage} to.
+ */
public Iterator<Host> select(final RequestMessage msg);
+ /**
+ * A simple round-robin strategy that simply selects the next host in the {@link Cluster} to send the
+ * {@link RequestMessage} to.
+ */
public static class RoundRobin implements LoadBalancingStrategy {
private final CopyOnWriteArrayList<Host> availableHosts = new CopyOnWriteArrayList<>();