Class LoadBalancingStrategy.RoundRobin
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.LoadBalancingStrategy.RoundRobin
-
- All Implemented Interfaces:
Host.Listener
,LoadBalancingStrategy
- Enclosing interface:
- LoadBalancingStrategy
public static class LoadBalancingStrategy.RoundRobin extends Object implements LoadBalancingStrategy
A simple round-robin strategy that simply selects the next host in theCluster
to send theRequestMessage
to.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.driver.LoadBalancingStrategy
LoadBalancingStrategy.RoundRobin
-
-
Constructor Summary
Constructors Constructor Description RoundRobin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(Cluster cluster, Collection<Host> hosts)
Initialize the strategy with theCluster
instance and the expected host list.void
onAvailable(Host host)
void
onNew(Host host)
void
onRemove(Host host)
void
onUnavailable(Host host)
Iterator<Host>
select(org.apache.tinkerpop.gremlin.util.message.RequestMessage msg)
Provide an ordered list of hosts to send the givenRequestMessage
to.
-
-
-
Method Detail
-
initialize
public void initialize(Cluster cluster, Collection<Host> hosts)
Description copied from interface:LoadBalancingStrategy
Initialize the strategy with theCluster
instance and the expected host list.- Specified by:
initialize
in interfaceLoadBalancingStrategy
-
select
public Iterator<Host> select(org.apache.tinkerpop.gremlin.util.message.RequestMessage msg)
Description copied from interface:LoadBalancingStrategy
Provide an ordered list of hosts to send the givenRequestMessage
to.- Specified by:
select
in interfaceLoadBalancingStrategy
-
onAvailable
public void onAvailable(Host host)
- Specified by:
onAvailable
in interfaceHost.Listener
-
onUnavailable
public void onUnavailable(Host host)
- Specified by:
onUnavailable
in interfaceHost.Listener
-
onNew
public void onNew(Host host)
- Specified by:
onNew
in interfaceHost.Listener
-
onRemove
public void onRemove(Host host)
- Specified by:
onRemove
in interfaceHost.Listener
-
-