Class ZooKeeperAvailabilityChecker
- java.lang.Object
-
- org.kiwiproject.curator.zookeeper.ZooKeeperAvailabilityChecker
-
public class ZooKeeperAvailabilityChecker extends Object
Utility for checking whether ZooKeeper servers are available.
-
-
Constructor Summary
Constructors Constructor Description ZooKeeperAvailabilityChecker()Create new instance using a defaultSocketChecker.ZooKeeperAvailabilityChecker(org.kiwiproject.net.SocketChecker socketChecker)Create new instance using the givenSocketChecker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleananyZooKeepersAvailable(String zkConnectString)Check if any ZooKeepers are available using the given connection string.booleananyZooKeepersAvailable(CuratorConfig curatorConfig)Check if any ZooKeepers are available using the connection string in theCuratorConfig.
-
-
-
Constructor Detail
-
ZooKeeperAvailabilityChecker
public ZooKeeperAvailabilityChecker()
Create new instance using a defaultSocketChecker.
-
ZooKeeperAvailabilityChecker
public ZooKeeperAvailabilityChecker(org.kiwiproject.net.SocketChecker socketChecker)
Create new instance using the givenSocketChecker.- 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 theCuratorConfig.- 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
-
-