[
https://issues.apache.org/jira/browse/CURATOR-590?focusedWorklogId=562352&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-562352
]
ASF GitHub Bot logged work on CURATOR-590:
------------------------------------------
Author: ASF GitHub Bot
Created on: 08/Mar/21 13:37
Start Date: 08/Mar/21 13:37
Worklog Time Spent: 10m
Work Description: TisonKun commented on a change in pull request #380:
URL: https://github.com/apache/curator/pull/380#discussion_r589425268
##########
File path:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
##########
@@ -462,7 +484,12 @@ else if ( existingPath != null && mode.isSequential() )
if ( localCreateMethod == null )
{
CreateBuilderMain createBuilder = mode.isTTL() ?
client.create().withTtl(ttl) : client.create();
- CreateModable<ACLBackgroundPathAndBytesable<String>>
tempCreateMethod = useProtection ?
createBuilder.creatingParentContainersIfNeeded().withProtection() :
createBuilder.creatingParentContainersIfNeeded();
+ CreateModable<ACLBackgroundPathAndBytesable<String>>
tempCreateMethod;
+ if (useParentCreation) {
Review comment:
I'd prefer write this piece of code like
```java
tempCreateMethod = createBuilder;
if (useParentCreation) {
tempCreateMethod = tempCreateMethod.creatingParentContainersIfNeeded();
}
if (useProtection) {
tempCreateMethod = tempCreateMethod.withProtection();
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 562352)
Time Spent: 1h 50m (was: 1h 40m)
> Adds possibility to disable parent creation for PersistentNode
> --------------------------------------------------------------
>
> Key: CURATOR-590
> URL: https://issues.apache.org/jira/browse/CURATOR-590
> Project: Apache Curator
> Issue Type: Improvement
> Components: Recipes
> Affects Versions: 4.3.0
> Reporter: Boutes Paul
> Priority: Minor
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> We should be able to add an option to the PersistentNode in order to turn
> parent creation off.
> For example:
> given this znode path containing some data:
> {noformat}
> /one/two{noformat}
> and a PersistentNode under
> {code:java}
> /one/two/three{code}
> If the former path is deleted (with deleting children if needed),
> the PersistentNode will recreate the full hierarchy but with empty data for
> {code:java}
> /one/two{code}
> That can be misleading for external process looking at these paths, thinking
> that something is up (wrongfully).
> The idea is to add a boolean flag to the PersistentNode recipe to disable the
> parent creation when creating / recreating znode in order to avoid such
> situation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)