[
https://issues.apache.org/jira/browse/HELIX-679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391988#comment-16391988
]
ASF GitHub Bot commented on HELIX-679:
--------------------------------------
GitHub user zhan849 opened a pull request:
https://github.com/apache/helix/pull/140
[HELIX-679] consolidate semantics of recursively delete path in ZkClient
This change consolidates semantics of APIs in ZkClient that recursively
deletes a path
* For backward compatibility, we keep `deleteRecursive()`, which will only
return true/false, and will not throw exception.
* create a new method called deleteRecursively() that will only throw
exception upon error.
* mark `deleteRecursive()` as deprecated as throwing exception can carry
error information
* make all current usage of `deleteRecursive()` to `deleteRecursively()`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhan849/helix harry/zk-client-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/helix/pull/140.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #140
----
commit 8412d3f7e7d8097eee820c4d055b1526ac74aca1
Author: hrzhang <hrzhang@...>
Date: 2018-03-08T22:04:42Z
[HELIX-679] consolidate semantics of recursively delete path in ZkClient
----
> Consolidated behaviors for deleteRecursive and deleteRecursively in ZkClient
> ----------------------------------------------------------------------------
>
> Key: HELIX-679
> URL: https://issues.apache.org/jira/browse/HELIX-679
> Project: Apache Helix
> Issue Type: Bug
> Components: helix-core
> Reporter: Hao Zhang
> Priority: Major
>
> According to it's documentation `deleteRecursive()` should return true if
> operation is successful else false. But the semantics of the base function
> (`delete()`) it calls is different: it returns true if operation is
> successful, returns false if node does not exist, throws exception upon other
> errors, and therefore `deleteRecursive()` will also throw exception, and will
> return false if any sub-path is deleted already, which is confusing
> To consolidate semantics, we should either have the function only return
> true/false or only throw exception upon error.
>
> Also, to make change backward compatible, I'd propose the following change:
> # deleteRecursive() will only return true/false, and will not throw
> exception. If subpath does not exist, it should consider successful
> # create a new method called deleteRecursively() that will only throw
> exception upon error.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)