org.apache.ignite.internal.client.balancer

## Class GridClientRandomBalancer

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

All Implemented Interfaces:
  GridClientLoadBalancer

    public class GridClientRandomBalancer
    extends GridClientBalancerAdapter

Simple balancer that relies on random node selection from a given collection. This implementation has no any caches and treats each given collection as a new one.

More strictly, for any non-empty collection of size `n` the probability of selection of any node in this collection will be `1/n`.

### Constructor Summary

Constructors
Constructor and Description
`GridClientRandomBalancer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`GridClientNode` `balancedNode(Collection<? extends GridClientNode> nodes)` Picks up a random node from a collection.

### 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

#### GridClientRandomBalancer

    public GridClientRandomBalancer()

### Method Detail

#### balancedNode

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

Picks up a random node from a collection.

Parameters:
  `nodes` - Nodes to pick from.
Returns:
  Random node from collection.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018