*
* @param client curator client
* @param path path to create, if needed
*/
public static void ensurePath(CuratorFramework client, String path) {
EnsurePath ensurePath = ensurePaths.get(path);
if (ensurePath == null) {
ensurePaths.putIfAbsent(path, client.newNamespaceAwareEnsurePath(path));
ensurePath = ensurePaths.get(path);
}
try {
ensurePath.ensure(client.getZookeeperClient());
}
catch (Exception e) {
throw ZooKeeperUtils.wrapThrowable(e);
}
}