Interface GridClientLoadBalancer
-
- All Known Implementing Classes:
GridClientBalancerAdapter,GridClientRandomBalancer,GridClientRoundRobinBalancer
public interface GridClientLoadBalancerInterface that defines a selection logic of a server node for a particular operation. Use it to define custom load balancing logic for client. Load balancer is specified viaGridClientConfiguration.getBalancer()configuration property.The following implementations are provided out of the box:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GridClientNodebalancedNode(Collection<? extends GridClientNode> nodes)Gets next node for executing client command.
-
-
-
Method Detail
-
balancedNode
GridClientNode balancedNode(Collection<? extends GridClientNode> nodes) throws GridClientException
Gets next node for executing client command.- 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.
-
-