Class NacosBalancer

java.lang.Object
com.alibaba.nacos.client.naming.core.Balancer
com.alibaba.cloud.nacos.balancer.NacosBalancer

public class NacosBalancer extends com.alibaba.nacos.client.naming.core.Balancer
Since:
2021.1
Author:
itmuch.com XuDaojie
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.alibaba.nacos.client.naming.core.Balancer

    com.alibaba.nacos.client.naming.core.Balancer.RandomByWeight
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.alibaba.nacos.api.naming.pojo.Instance
    getHostByRandomWeight2(List<com.alibaba.nacos.api.naming.pojo.Instance> instances)
    Choose instance by weight.
    static org.springframework.cloud.client.ServiceInstance
    getHostByRandomWeight3(List<org.springframework.cloud.client.ServiceInstance> serviceInstances)
    Spring Cloud LoadBalancer Choose instance by weight.

    Methods inherited from class com.alibaba.nacos.client.naming.core.Balancer

    getHostByRandomWeight

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NacosBalancer

      public NacosBalancer()
  • Method Details

    • getHostByRandomWeight2

      public static com.alibaba.nacos.api.naming.pojo.Instance getHostByRandomWeight2(List<com.alibaba.nacos.api.naming.pojo.Instance> instances)
      Choose instance by weight.
      Parameters:
      instances - Instance List
      Returns:
      the chosen instance
    • getHostByRandomWeight3

      public static org.springframework.cloud.client.ServiceInstance getHostByRandomWeight3(List<org.springframework.cloud.client.ServiceInstance> serviceInstances)
      Spring Cloud LoadBalancer Choose instance by weight.
      Parameters:
      serviceInstances - Instance List
      Returns:
      the chosen instance