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 the client is configured with
ClientNetworkConfig.isSmartRouting(), operations that are not key-based will be routed to the endpoint returned by the LoadBalancer. For non-smart clients, the
LoadBalanceris not used.
For configuration see
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description
canGetNextDataMember()Deprecated.Since 5.0, the method is unused
init(Cluster cluster, ClientConfig config)Initializes the LoadBalancer.
next()Returns the next member to route to.
nextDataMember()Deprecated.Since 5.0, the method is unused
void init(Cluster cluster, ClientConfig config)Initializes the LoadBalancer.
cluster- the Cluster this LoadBalancer uses to select members from.
config- the ClientConfig.
Member next()Returns the next member to route to.
- Returns the next member or null if no member is available
@Deprecated default Member nextDataMember()Deprecated.Since 5.0, the method is unusedReturns the next data member or null if no data member is available.
java.lang.UnsupportedOperationException- if the operation is not supported by this instance