public final class LoadBalanceHelper extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T extends IServer> |
commonHash(List<T> servers,
com.github.houbb.hash.api.IHashCode hash,
String hashKey)
通用 hash 策略
|
static <T extends IServer> |
consistentHash(List<T> servers,
com.github.houbb.hash.api.IHashCode hash,
String hashKey)
一致性 hash 策略
|
static <T extends IServer> |
random(List<T> servers)
随机选择
|
static <T extends IServer> |
roundRobbin(List<T> servers)
轮训
|
static <T extends IServer> |
weightRoundRobbin(List<T> servers)
轮训权重
|
public static <T extends IServer> T random(List<T> servers)
servers - 列表public static <T extends IServer> T roundRobbin(List<T> servers)
servers - 列表public static <T extends IServer> T weightRoundRobbin(List<T> servers)
servers - 列表public static <T extends IServer> T commonHash(List<T> servers, com.github.houbb.hash.api.IHashCode hash, String hashKey)
servers - 列表hash - hash 策略hashKey - hashCopyright © 2022. All rights reserved.