Ribbon之ILoadBalancer
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,Ribbon 负载均衡的连轴方法,它聚合来IPing,IRule, ServerList, ServerListUpdater, ServerListFilter。ILoadBalancerpubli
千家信息网最后更新 2026年11月01日Ribbon之ILoadBalancer
Ribbon 负载均衡的连轴方法,它聚合来IPing,IRule, ServerList, ServerListUpdater, ServerListFilter。
ILoadBalancer
public interface ILoadBalancer { /** * Initial list of servers. * This API also serves to add additional ones at a later time * The same logical server (host:port) could essentially be added multiple times * (helpful in cases where you want to give more "weightage" perhaps ..) * * @param newServers new servers to add */ public void addServers(List newServers); /** * Choose a server from load balancer. * * @param key An object that the load balancer may use to determine which server to return. null if * the load balancer does not use this parameter. * @return server chosen */ public Server chooseServer(Object key); /** * To be called by the clients of the load balancer to notify that a Server is down * else, the LB will think its still Alive until the next Ping cycle - potentially * (assuming that the LB Impl does a ping) * * @param server Server to mark as down */ public void markServerDown(Server server); /** * @deprecated 2016-01-20 This method is deprecated in favor of the * cleaner {@link #getReachableServers} (equivalent to availableOnly=true) * and {@link #getAllServers} API (equivalent to availableOnly=false). * * Get the current list of servers. * * @param availableOnly if true, only live and available servers should be returned */ @Deprecated public List getServerList(boolean availableOnly); /** * @return Only the servers that are up and reachable. */ public List getReachableServers(); /** * @return All known servers, both reachable and unreachable. */ public List getAllServers();} AbstractLoadBalancer
public abstract class AbstractLoadBalancer implements ILoadBalancer { public enum ServerGroup{ ALL, STATUS_UP, STATUS_NOT_UP } /** * delegate to {@link #chooseServer(Object)} with parameter null. */ public Server chooseServer() { return chooseServer(null); } /** * List of servers that this Loadbalancer knows about * * @param serverGroup Servers grouped by status, e.g., {@link ServerGroup#STATUS_UP} */ public abstract List getServerList(ServerGroup serverGroup); /** * Obtain LoadBalancer related Statistics */ public abstract LoadBalancerStats getLoadBalancerStats(); } BaseLoadBalancer
基本实现了ILoadBalancer所使用的接口。
DynamicServerListLoadBalancer
在BaseLoadBalancer上,增加额外特性。这里主要是实现动态的服务列表特性。
- ZoneAwareLoadBalancer
在DynamicServerListLoadBalancer之上,增加了额外的特性。分zone的形式来配置多个loadBalancer.
特性
均衡
动态
增加额
多个
形式
接口
方法
服务
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
上海挚品互联网科技有限公司
互联网科技工作委员会主任
互联网科技深圳
互联网科技开发公司
互联网科技排名
华中科技大学互联网
互联网金融科技平台
互联网为啥属于高科技
未来五年的互联网科技
特约风豹互联网科技为什么扣费
恒生互联网科技业指数调整周期
广州互联网高科技取餐柜
扫呗互联网科技有限公司
广州梦谷互联网科技有限公司领导
唯美互联网科技
长沙渺峰互联网科技有限公司
互联网科技手抄报图片
美国五大互联网科技公司市值多少
广西泛欧互联网科技有限公司
瑞安市蟠桃会互联网科技有限公司
喔噻互联网科技有限公司
河南云网互联网络科技有限公司
深圳科技互联网
互联网科技英文翻译
华服互联网科技官网
链环科技传统企业怎么转型互联网
四川慕妮娅互联网科技有限公司
下一代互联网重大应用科技园
郑州欣桑互联网科技有限公司
亚光科技低轨卫星互联网