Menu

#11 Need deleteRecursively method

closed
nobody
None
5
2008-06-10
2008-04-12
Anonymous
No

Here is my implementation. This is possibly not the greatest practice in a running system, but it is very handy when debugging (if you need to clean up all state before starting again).

void deleteRecursively(String path, int version) throws KeeperException, InterruptedException {
for (String child : zk.getChildren(path, false)) {
deleteRecursively(path.replaceAll("/?$", "/") + child);
}
zk.delete(path, version);
}

Discussion

  • Patrick Hunt

    Patrick Hunt - 2008-06-10
    • status: open --> closed
     
  • Patrick Hunt

    Patrick Hunt - 2008-06-10

    Logged In: YES
    user_id=12853
    Originator: NO

    Moved to Apache https://issues.apache.org/jira/browse/ZOOKEEPER-31

     

Log in to post a comment.