CURATOR-590: Add option to disable parent creation for PersistentNode
authorPaul Boutes <paul.boutes@elastic.co>
Tue, 9 Mar 2021 07:11:49 +0000 (08:11 +0100)
committerEnrico Olivelli <eolivelli@apache.org>
Tue, 9 Mar 2021 07:11:49 +0000 (08:11 +0100)
commit4a11aaef8b190dc220d35b7a91df294bfa06250e
treeaa9cc25f74e738019d73151d00389dcf90706309
parentd5666ab9ca22f45b905d6ffbf2b33fa30b38e15e
CURATOR-590: Add option to disable parent creation for PersistentNode

Adds a `useParentCreation` boolean flag to control the parent creation.

If this flag is set to `false`, the `PersistentNode` won't create the underlying znodes with the `createParentContainersIfNeeded()`, meaning that the parent znodes will have to exist beforehand in order for the `PersistentNode` to succeed its creation.

The `useParentCreation` flag is set to `true` by default.

https://issues.apache.org/jira/browse/CURATOR-590

Author: Paul Boutes <paul.boutes@elastic.co>
Author: Paul Boutes <paul.boutes@gmail.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Cameron McKenzie <mckenzie.cam@gmail.com>, Zili Chen <wander4096@gmail.com>, Jordan Zimmerman <jordan@jordanzimmerman.com>

Closes #380 from pboutes/CURATOR-590
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java