Package com.hazelcast.client
Interface LoadBalancer
- All Known Implementing Classes:
AbstractLoadBalancer
,RandomLB
,RoundRobinLB
,StaticLB
public interface LoadBalancer
LoadBalancer
allows 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 LoadBalancer
is not used.
For configuration see ClientConfig.setLoadBalancer(LoadBalancer)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Deprecated.Since 5.0, the method is unusedvoid
init
(Cluster cluster, ClientConfig config) Initializes the LoadBalancer.next()
Returns the next member to route to.default Member
Deprecated.Since 5.0, the method is unused
-
Method Details
-
init
Initializes the LoadBalancer.- Parameters:
cluster
- the Cluster this LoadBalancer uses to select members from.config
- the ClientConfig.
-
next
Member next()Returns the next member to route to.- Returns:
- Returns the next member or null if no member is available
-
nextDataMember
Deprecated.Since 5.0, the method is unusedReturns the next data member or null if no data member is available.- Throws:
UnsupportedOperationException
- if the operation is not supported by this instance- Since:
- 4.2
-
canGetNextDataMember
Deprecated.Since 5.0, the method is unusedReturns whether this instance supports getting data members through a call tonextDataMember()
.- Since:
- 4.2
- See Also:
-