org.apache.tinkerpop.gremlin.driver

## 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
    Constructor and Description
    `RoundRobin()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `initialize(Cluster cluster, Collection<Host> hosts)` Initialize the strategy with the `Cluster` 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.driver.message.RequestMessage msg)` Provide an ordered list of hosts to send the given `RequestMessage` to.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RoundRobin

          public RoundRobin()

  - ### Method Detail

    - #### initialize

          public void initialize(Cluster cluster,
                                 Collection<Host> hosts)

      Description copied from interface: `LoadBalancingStrategy`
      Initialize the strategy with the `Cluster` instance and the expected host list.
      Specified by:
        `initialize` in interface `LoadBalancingStrategy`

    - #### select

          public Iterator<Host> select(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)

      Description copied from interface: `LoadBalancingStrategy`
      Provide an ordered list of hosts to send the given `RequestMessage` to.
      Specified by:
        `select` in interface `LoadBalancingStrategy`

    - #### onAvailable

          public void onAvailable(Host host)

      Specified by:
        `onAvailable` in interface `Host.Listener`

    - #### onUnavailable

          public void onUnavailable(Host host)

      Specified by:
        `onUnavailable` in interface `Host.Listener`

    - #### onNew

          public void onNew(Host host)

      Specified by:
        `onNew` in interface `Host.Listener`

    - #### onRemove

          public void onRemove(Host host)

      Specified by:
        `onRemove` in interface `Host.Listener`

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.