org.apache.ignite.internal.client.balancer

## Class GridClientRoundRobinBalancer

- java.lang.Object
- - org.apache.ignite.internal.client.balancer.GridClientBalancerAdapter
  - - org.apache.ignite.internal.client.balancer.GridClientRoundRobinBalancer

All Implemented Interfaces:
  GridClientLoadBalancer, GridClientTopologyListener

    public class GridClientRoundRobinBalancer
    extends GridClientBalancerAdapter
    implements GridClientTopologyListener

Simple balancer that implements round-robin balancing.

### Constructor Summary

Constructors
Constructor and Description
`GridClientRoundRobinBalancer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`GridClientNode` `balancedNode(Collection<? extends GridClientNode> nodes)` Gets next node for executing client command.
`void` `onNodeAdded(GridClientNode node)` Callback for new nodes joining the remote grid.
`void` `onNodeRemoved(GridClientNode node)` Callback for nodes leaving the remote grid.

### Methods inherited from class org.apache.ignite.internal.client.balancer.GridClientBalancerAdapter

`isPreferDirectNodes, selectDirectNodes, setPreferDirectNodes`

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

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

### Constructor Detail

#### GridClientRoundRobinBalancer

    public GridClientRoundRobinBalancer()

### Method Detail

#### balancedNode

    public GridClientNode balancedNode(Collection<? extends GridClientNode> nodes)
                                throws GridClientException

Gets next node for executing client command.

Specified by:
  `balancedNode` in interface `GridClientLoadBalancer`
Parameters:
  `nodes` - Nodes to pick from, should not be empty.
Returns:
  Next node to pick.
Throws:
  `GridClientException` - If balancer can't match given nodes with current topology snapshot.

#### onNodeAdded

    public void onNodeAdded(GridClientNode node)

Callback for new nodes joining the remote grid.

Specified by:
  `onNodeAdded` in interface `GridClientTopologyListener`
Parameters:
  `node` - New remote node.

#### onNodeRemoved

    public void onNodeRemoved(GridClientNode node)

Callback for nodes leaving the remote grid.

Specified by:
  `onNodeRemoved` in interface `GridClientTopologyListener`
Parameters:
  `node` - Left node.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018