Interface LoadBalancerObserver


public interface LoadBalancerObserver
An observer that provides visibility into a LoadBalancer.
  • Method Details

    • hostObserver

      LoadBalancerObserver.HostObserver hostObserver(Object resolvedAddress)
      Parameters:
      resolvedAddress - the resolved address of the host.
      Returns:
      a LoadBalancerObserver.HostObserver.
    • onNoHostsAvailable

      void onNoHostsAvailable()
      Callback for when connection selection fails due to no hosts being available.
    • onServiceDiscoveryEvent

      void onServiceDiscoveryEvent(Collection<? extends ServiceDiscovererEvent<?>> events, int oldHostSetSize, int newHostSetSize)
      Callback for monitoring the changes due to a service discovery update.
      Parameters:
      events - the collection of ServiceDiscovererEvents received by the load balancer.
      oldHostSetSize - the size of the previous host set.
      newHostSetSize - the new size of the host set.
    • onNoActiveHostsAvailable

      void onNoActiveHostsAvailable(int hostSetSize, NoActiveHostException exception)
      Callback for when connection selection fails due to all hosts being inactive.
      Parameters:
      hostSetSize - the size of the current host set.
      exception - an exception with more details about the failure.