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 Description GridClientRandomBalancer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridClientNodebalancedNode(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
-
-
-
-
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.
-
-