Class LoadBalancer

java.lang.Object
org.apache.phoenix.loadbalancer.service.LoadBalancer

public class LoadBalancer extends Object
LoadBalancer class is singleton , used by the client to find out about various location of PQS servers. The client needs to configure the HBase-site.xml with the needed properties i.e. location of zookeeper ( or service locator), username, password etc.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Method Details

    • getLoadBalancer

      public static LoadBalancer getLoadBalancer()
      Return Singleton Load Balancer every single time.
      Returns:
      LoadBalancer
    • getSingleServiceLocation

      public HostAndPort getSingleServiceLocation() throws Exception
      It returns the location of Phoenix Query Server in form of a HostAndPort (copied from Guava) from the cache. The client should catch Exception incase the method is unable to fetch PQS location due to network failure or in-correct configuration issues.
      Returns:
      - return HostAndPort
      Throws:
      Exception
    • getAllServiceLocation

      public List<HostAndPort> getAllServiceLocation() throws Exception
      return locations of all Phoenix Query Servers in the form of a List of PQS servers
      Returns:
      - HostAndPort
      Throws:
      Exception