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 the
Cluster to send the
RequestMessage to.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.driver.LoadBalancingStrategy
LoadBalancingStrategy.RoundRobin -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(Cluster cluster, Collection<Host> hosts) Initialize the strategy with theClusterinstance and the expected host list.voidonAvailable(Host host) voidvoidvoidonUnavailable(Host host) select(RequestMessage msg) Provide an ordered list of hosts to send the givenRequestMessageto.
-
Constructor Details
-
RoundRobin
public RoundRobin()
-
-
Method Details
-
initialize
Description copied from interface:LoadBalancingStrategyInitialize the strategy with theClusterinstance and the expected host list.- Specified by:
initializein interfaceLoadBalancingStrategy
-
select
Description copied from interface:LoadBalancingStrategyProvide an ordered list of hosts to send the givenRequestMessageto.- Specified by:
selectin interfaceLoadBalancingStrategy
-
onAvailable
- Specified by:
onAvailablein interfaceHost.Listener
-
onNew
- Specified by:
onNewin interfaceHost.Listener
-
onRemove
- Specified by:
onRemovein interfaceHost.Listener
-