public class StaticLB extends Object implements LoadBalancer
LoadBalancer
that always returns the same member. This can
be useful for testing if you want to hit a specific member.Modifier and Type | Method and Description |
---|---|
boolean |
canGetNextDataMember()
Returns whether this instance supports getting data members through a call to
LoadBalancer.nextDataMember() . |
void |
init(Cluster cluster,
ClientConfig config)
Initializes the LoadBalancer.
|
Member |
next()
Returns the next member to route to.
|
Member |
nextDataMember()
Returns the next data member to route to.
|
public StaticLB(Member member)
public void init(Cluster cluster, ClientConfig config)
LoadBalancer
init
in interface LoadBalancer
cluster
- the Cluster this LoadBalancer uses to select members from.config
- the ClientConfig.public Member next()
LoadBalancer
next
in interface LoadBalancer
public Member nextDataMember()
LoadBalancer
nextDataMember
in interface LoadBalancer
public boolean canGetNextDataMember()
LoadBalancer
LoadBalancer.nextDataMember()
.
This method is used by components that require communication with data members only, such as the SQL engine.
canGetNextDataMember
in interface LoadBalancer
true
if this instance supports getting data members through a call to LoadBalancer.nextDataMember()
LoadBalancer.nextDataMember()
Copyright © 2022 Hazelcast, Inc.. All rights reserved.