[
https://issues.apache.org/jira/browse/CURATOR-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082595#comment-14082595
]
ASF GitHub Bot commented on CURATOR-120:
----------------------------------------
Github user dragonsinth commented on the pull request:
https://github.com/apache/curator/pull/16#issuecomment-50913715
Up to you guys. I don't need it personally anymore, but if you think it
would be useful, I'm happy to do the work to land it. Let's just decide on
what exactly we want. As I mentioned, I'm loathe to add more constructor
arguments as there are already so many overloads.
What would you think about either a builder, or else a fluent constructor
api?
Builder example:
```
cache = PathChildrenCache.newBuilder(client, path)
.ensurePath(false)
.cacheData(false)
.compress(true)
.withExecutor(executor)
.build()
cache.start();
```
Fluent constructor:
```
cache = new PathChildrenCache(client, path)
.ensurePath(false)
.cacheData(false)
.compress(true)
.withExecutor(executor)
.start()
```
In this formulation, essentially the new PathChildrenCache modifies its
configuration each time, returning itself, which is legal up until start() is
called. Once start() is called it's illegal state exception to try to call any
of the config methods.
Either way, all of the existing defaults would hold for items not specified.
> NodeCache and PathChildrenCache should not perform writes
> ---------------------------------------------------------
>
> Key: CURATOR-120
> URL: https://issues.apache.org/jira/browse/CURATOR-120
> Project: Apache Curator
> Issue Type: Improvement
> Components: Recipes
> Reporter: Scott Blum
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> NodeCache and PathChildrenCache should act as read-only views of data.
> Unnecessarily, both of them forcibly create the node being watched.
--
This message was sent by Atlassian JIRA
(v6.2#6252)