Class ZooKeeperAvailabilityChecker


  • public class ZooKeeperAvailabilityChecker
    extends Object
    Utility for checking whether ZooKeeper servers are available.
    • Constructor Detail

      • ZooKeeperAvailabilityChecker

        public ZooKeeperAvailabilityChecker()
        Create new instance using a default SocketChecker.
      • ZooKeeperAvailabilityChecker

        public ZooKeeperAvailabilityChecker​(org.kiwiproject.net.SocketChecker socketChecker)
        Create new instance using the given SocketChecker.
        Parameters:
        socketChecker - the checker to use
    • Method Detail

      • anyZooKeepersAvailable

        public boolean anyZooKeepersAvailable​(CuratorConfig curatorConfig)
        Check if any ZooKeepers are available using the connection string in the CuratorConfig.
        Parameters:
        curatorConfig - the CuratorConfig containing a ZooKeeper connection string
        Returns:
        true if a ZooKeeper is available at the given connection string, otherwise false
      • anyZooKeepersAvailable

        public boolean anyZooKeepersAvailable​(String zkConnectString)
        Check if any ZooKeepers are available using the given connection string.
        Parameters:
        zkConnectString - the ZooKeeper connection string
        Returns:
        true if a ZooKeeper is available at the given connection string, otherwise false