xyuanlu commented on code in PR #2994: URL: https://github.com/apache/helix/pull/2994#discussion_r1927786226
########## zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java: ########## @@ -1820,6 +1826,75 @@ public void deleteRecursively(String path) throws ZkClientException { } } + /** + * Delete the path as well as all its children. This operation is atomic and will either delete all nodes or none. + * This operation may fail if another agent is concurrently creating or deleting nodes under the path. + * @param path ZK path to delete + */ + public void deleteRecursivelyAtomic(String path) { + deleteRecursivelyAtomic(Arrays.asList(path)); + } + + /** + * Delete the paths as well as all their children. This operation is atomic and will either delete all nodes or none. + * This operation may fail if another agent is concurrently creating or deleting nodes under any of the paths. + * @param paths ZK paths to delete + */ + public void deleteRecursivelyAtomic(List<String> paths) { + List<Op> ops = new ArrayList<>(); + List<OpResult> opResults; + for (String path : paths) { + ops.addAll(getOpsForRecursiveDelete(path)); + } + try { Review Comment: Add special handling for catch (ZkNoNodeException e) { // if the node to be deleted does not exist, treat it as success. return; } So that we have feature parity -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For additional commands, e-mail: reviews-h...@helix.apache.org