The Iloadbalancer of the Ribbon

Source: Internet
Author: User
Tags deprecated

Ribbon load-balanced coupling method, which converges to 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&nbsp ...)     *     *  @param  newservers new servers  to add    */   public void addservers (List<Server > 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< Server> getserverlist (boolean availableonly);   /**    *  @return  Only the servers that are up and reachable.      */    public list<server> getreachableservers ();     /**     *  @return  All known servers, both  reachable and unreachable.     */   public list< Server> 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<server> getserverlist ( Servergroup servergroup);        /**      * Obtain LoadBalancer related Statistics     */     public abstract loadbalancerstats getloadbalancerstats ();     }
    • Baseloadbalancer

The interface used by Iloadbalancer is basically implemented.

    • Dynamicserverlistloadbalancer

On the Baseloadbalancer, add extra features. This is mainly to implement dynamic service list features.

    • Zoneawareloadbalancer

On top of the Dynamicserverlistloadbalancer, additional features are added. To configure multiple loadbalancer in the form of a zone.



















The Iloadbalancer of the Ribbon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.