Skip to content
Permalink
Browse files
optimize_zk_create (#1833)
  • Loading branch information
whanice authored and beiwei30 committed May 25, 2018
1 parent 0bf6910 commit db03f8c42b2cf33a9303233e31a4c9b8f88b836d
Showing 1 changed file with 6 additions and 4 deletions.
@@ -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);

0 comments on commit db03f8c

Please sign in to comment.