Class 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 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.