Skip to content

Commit

Permalink
optimize_zk_create (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
whanice authored and beiwei30 committed May 25, 2018
1 parent 0bf6910 commit db03f8c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ public URL getUrl() {

@Override
public void create(String path, boolean ephemeral) {
if (!ephemeral) {
if (checkExists(path)) {
return;
}
}
int i = path.lastIndexOf('/');
if (i > 0) {
String parentPath = path.substring(0, i);
if (!checkExists(parentPath)) {
create(parentPath, false);
}
create(path.substring(0, i), false);
}
if (ephemeral) {
createEphemeral(path);
Expand Down

0 comments on commit db03f8c

Please sign in to comment.