Class D2HealthChecker


  • public class D2HealthChecker
    extends java.lang.Object
    Runs a daemon thread that consistently sends HTTP GET request to admin healthcheck endpoint. If there are consecutive N bad status, shuts down zookeeper announcer and waits until it receives N consecutive good status to restart ZooKeeperAnnouncer
    • Constructor Summary

      Constructors 
      Constructor Description
      D2HealthChecker​(com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager zkManager, long intervalMs, java.lang.String healthCheckUrl, int minConsecutiveCount, java.util.concurrent.ScheduledExecutorService executorService, int httpTimeoutMs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isBadState()  
      void shutdown()  
      void start()  
      • Methods inherited from class java.lang.Object

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

      • D2HealthChecker

        public D2HealthChecker​(com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager zkManager,
                               long intervalMs,
                               java.lang.String healthCheckUrl,
                               int minConsecutiveCount,
                               java.util.concurrent.ScheduledExecutorService executorService,
                               int httpTimeoutMs)
    • Method Detail

      • shutdown

        public void shutdown()
      • start

        public void start()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isBadState

        public boolean isBadState()