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 or null if no data member is available.
|
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()
.canGetNextDataMember
in interface LoadBalancer
LoadBalancer.nextDataMember()
Copyright © 2023 Hazelcast, Inc.. All rights reserved.