diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-05-28 17:31:30 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-05-28 17:31:30 +0200 |
commit | 33ec86e7ddd01c693341145e990c4317cadbd749 (patch) | |
tree | 0d501ed6e1ed12ba2ee451e5e16386f7b819b5ba /zkfacade/src/main | |
parent | dbcce634514f8e73ba9f3c8f6b43d5a3ca17625a (diff) |
Return whether a path was attempted created in Curator#create
Diffstat (limited to 'zkfacade/src/main')
-rw-r--r-- | zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java index bc47a02ea19..af5716f2e52 100644 --- a/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java +++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/Curator.java @@ -225,9 +225,10 @@ public class Curator implements AutoCloseable { /** * Creates an empty node at a path, creating any parents as necessary. * If the node already exists nothing is done. + * Returns whether a change was attempted. */ - public void create(Path path) { - if (exists(path)) return; + public boolean create(Path path) { + if (exists(path)) return false; String absolutePath = path.getAbsolute(); try { @@ -237,6 +238,7 @@ public class Curator implements AutoCloseable { } catch (Exception e) { throw new RuntimeException("Could not create " + absolutePath, e); } + return true; } /** |