Class Balancer
- java.lang.Object
-
- com.alibaba.nacos.client.naming.core.Balancer
-
public class Balancer extends Object
- Author:
- xuanyin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBalancer.RandomByWeight
-
Field Summary
Fields Modifier and Type Field Description static List<String>UNCONSISTENT_SERVICE_WITH_ADDRESS_SERVERreport status to server
-
Constructor Summary
Constructors Constructor Description Balancer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static com.alibaba.nacos.api.naming.pojo.InstancegetHostByRandomWeight(List<com.alibaba.nacos.api.naming.pojo.Instance> hosts)Return one host from the host list by random-weight.
-
-
-
Method Detail
-
getHostByRandomWeight
protected static com.alibaba.nacos.api.naming.pojo.Instance getHostByRandomWeight(List<com.alibaba.nacos.api.naming.pojo.Instance> hosts)
Return one host from the host list by random-weight.- Parameters:
hosts- The list of the host.- Returns:
- The random-weight result of the host
-
-