public CuratorFramework mkClientImpl(Map<String, Object> conf, List<String> servers, Object port, String root,
final WatcherCallBack watcher, Map<String, Object> authConf, DaemonType type) {
CuratorFramework fk;
if (authConf != null) {
fk = CuratorUtils.newCurator(conf, servers, port, root, new ZookeeperAuthInfo(authConf), type.getDefaultZkAcls(conf));
} else {
fk = CuratorUtils.newCurator(conf, servers, port, root, null, type.getDefaultZkAcls(conf));
}
fk.getCuratorListenable().addListener((unused, e) -> {
if (e.getType().equals(CuratorEventType.WATCHED)) {
WatchedEvent event = e.getWatchedEvent();
watcher.execute(event.getState(), event.getType(), event.getPath());
}
});
LOG.info("Starting ZK Curator");
fk.start();
return fk;
}
}