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 Client is configured with ClientNetworkConfig.isSmartRouting()
,
only the operations that are not key based will be routed to the endpoint returned by the LoadBalancer. If it is
not ClientNetworkConfig.isSmartRouting()
, LoadBalancer
will not be used.
For configuration see ClientConfig.setLoadBalancer(LoadBalancer)
Modifier and Type | Method and Description |
---|---|
default boolean |
canGetNextDataMember()
Returns whether this instance supports getting data members through a call to
nextDataMember() . |
void |
init(Cluster cluster,
ClientConfig config)
Initializes the LoadBalancer.
|
Member |
next()
Returns the next member to route to.
|
default Member |
nextDataMember()
Returns the next data member to route to.
|
void init(Cluster cluster, ClientConfig config)
cluster
- the Cluster this LoadBalancer uses to select members from.config
- the ClientConfig.Member next()
default Member nextDataMember()
UnsupportedOperationException
- if the operation is not supported by this instancedefault boolean canGetNextDataMember()
nextDataMember()
.
This method is used by components that require communication with data members only, such as the SQL engine.
true
if this instance supports getting data members through a call to nextDataMember()
nextDataMember()
Copyright © 2022 Hazelcast, Inc.. All rights reserved.