/** * Make sure all the nodes in the path are created. NOTE: Unlike File.mkdirs(), Zookeeper doesn't distinguish * between directories and files. So, every node in the path is created. The data for each node is an empty blob * * @param zookeeper the client * @param path path to ensure * @throws InterruptedException thread interruption * @throws org.apache.zookeeper.KeeperException * Zookeeper errors */ public static void mkdirs(ZooKeeper zookeeper, String path) throws InterruptedException, KeeperException { mkdirs(zookeeper, path, true); }
@Override public Object call() throws Exception { ZKPaths.mkdirs(client.getZooKeeper(), path, makeLastNode); helper.set(doNothingHelper); isSet = true; return null; } }
@Override public void performBackgroundOperation(OperationAndData<PathAndBytes> dummy) throws Exception { try { ZKPaths.mkdirs(client.getZooKeeper(), mainOperationAndData.getData().getPath(), false); } catch ( KeeperException e ) { // ignore } client.queueOperation(mainOperationAndData); } };
ZKPaths.mkdirs(client.getZooKeeper(), path, false); createdPath = client.getZooKeeper().create(path, data, acling.getAclList(path), createMode);