public interface LoadBalancingStrategy<K>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addConnectResult(K key,
RequestTracker.RequestResult result,
long connectTimeNanos)
Offers information about a connection result.
|
K |
nextBackend()
Gets the next backend that a request should be sent to.
|
void |
offerBackends(Set<K> offeredBackends,
Closure<Collection<K>> onBackendsChosen)
Offers a set of backends that the load balancer should choose from to
distribute load amongst.
|
void offerBackends(Set<K> offeredBackends, Closure<Collection<K>> onBackendsChosen)
offeredBackends - Backends to choose from.onBackendsChosen - A callback that should be notified when the offered backends
have been (re)chosen from.K nextBackend() throws ResourceExhaustedException
com.lakeside.thrift.ResourceExhaustedException - If there are no available backends.ResourceExhaustedExceptionvoid addConnectResult(K key, RequestTracker.RequestResult result, long connectTimeNanos)
key - Backend key.result - Connection result.connectTimeNanos - Time spent waiting for connection to be established.Copyright © 2015 Baifendian Corporation. All rights reserved.