public interface LoadBalancer
LoadBalancerallows you to send operations to one of a number of endpoints(Members). It is up to the implementation to use different load balancing policies.
If Client is configured with
only the operations that are not key based will be routed to the endpoint returned by the LoadBalancer. If it is
LoadBalancer will not be used.
For configuration see
Modifier and Type Method Description
()Returns whether this instance supports getting data members through a call to
Cluster cluster, ClientConfig config)(Initializes the LoadBalancer.
()Returns the next member to route to.
()Returns the next data member to route to.
initInitializes the LoadBalancer.
cluster- the Cluster this LoadBalancer uses to select members from.
config- the ClientConfig.
nextMember next()Returns the next member to route to.
- Returns the next member or null if no member is available
nextDataMemberdefault Member nextDataMember()Returns the next data member to route to.
- Returns the next data member or null if no data member is available
UnsupportedOperationException- if the operation is not supported by this instance
canGetNextDataMemberdefault boolean canGetNextDataMember()Returns whether this instance supports getting data members through a call to
This method is used by components that require communication with data members only, such as the SQL engine.