use of com.linkedin.d2.discovery.stores.zk.ZooKeeperPermanentStore in project rest.li by linkedin.
the class LoadBalancerClientCli method hasService.
public static boolean hasService(ZKConnection zkclient, String zkserver, String d2path, String cluster, String service) throws URISyntaxException, IOException, PropertyStoreException {
ZooKeeperPermanentStore<ServiceProperties> zkServiceRegistry = null;
String scstoreString = zkserver + ZKFSUtil.servicePath(d2path);
zkServiceRegistry = (ZooKeeperPermanentStore<ServiceProperties>) getStore(zkclient, scstoreString, new ServicePropertiesJsonSerializer());
return zkServiceRegistry.get(service).getClusterName().equals(cluster);
}
Aggregations