curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From madrob <...@git.apache.org>
Subject [GitHub] curator pull request: Added new apis to add additional paths to Ch...
Date Wed, 10 Dec 2014 14:59:31 GMT
Github user madrob commented on a diff in the pull request:

    https://github.com/apache/curator/pull/57#discussion_r21607747
  
    --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/ChildReaper.java
---
    @@ -104,11 +106,11 @@ public ChildReaper(CuratorFramework client, String path, Reaper.Mode
mode, Sched
         public ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, ScheduledExecutorService
executor, int reapingThresholdMs, String leaderPath)
    --- End diff --
    
    Sorry, thought I responded to the builder comment earlier... Adding a proper builder would
be great, it would feel more like the rest of the Curator tools then. I'm not sure that being
able to chain calls to `add()` does enough though. The use case I have in mind is adding a
set of paths to all be reaped. Previously the code would look something like (pseudo-code):
    
    for (String path : paths) { new ChildReaper(..., path, ...); }
    
    Now the intent is clearly to consolidate on reapers, so the inutitive thing to do would
be
    
    r = new ChildReaper();
    for (String path : paths) { r.addPath(r); }
    
    Unfortunately, the constructor requires a path, so either the first path has to be added
twice (while it is not apparent from the client perspective that this is safe) or the client
has to switch away from a for-each and to a loop that starts on the second element.\
    
    Maybe this can all be sufficiently addressed using javadoc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message