curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-144) TreeCache should use a builder for advanced options
Date Fri, 22 Aug 2014 22:12:10 GMT

    [ https://issues.apache.org/jira/browse/CURATOR-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14107597#comment-14107597
] 

ASF GitHub Bot commented on CURATOR-144:
----------------------------------------

Github user madrob commented on a diff in the pull request:

    https://github.com/apache/curator/pull/41#discussion_r16624162
  
    --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
---
    @@ -356,51 +456,24 @@ public void stateChanged(CuratorFramework client, ConnectionState
newState)
             }
         };
     
    -    private static final ThreadFactory defaultThreadFactory = ThreadUtils.newThreadFactory("TreeCache");
    -
    -    /**
    -     * @param client    the client
    -     * @param path      path to watch
    -     * @param cacheData if true, node contents are cached in addition to the stat
    -     */
    -    public TreeCache(CuratorFramework client, String path, boolean cacheData)
    -    {
    -        this(client, path, cacheData, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(defaultThreadFactory),
true));
    -    }
    -
    -    /**
    -     * @param client        the client
    -     * @param path          path to watch
    -     * @param cacheData     if true, node contents are cached in addition to the stat
    -     * @param threadFactory factory to use when creating internal threads
    -     */
    -    public TreeCache(CuratorFramework client, String path, boolean cacheData, ThreadFactory
threadFactory)
    -    {
    -        this(client, path, cacheData, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(threadFactory),
true));
    -    }
    +    static final ThreadFactory defaultThreadFactory = ThreadUtils.newThreadFactory("TreeCache");
     
         /**
    -     * @param client           the client
    -     * @param path             path to watch
    -     * @param cacheData        if true, node contents are cached in addition to the stat
    -     * @param dataIsCompressed if true, data in the path is compressed
    -     * @param threadFactory    factory to use when creating internal threads
    -     */
    -    public TreeCache(CuratorFramework client, String path, boolean cacheData, boolean
dataIsCompressed, ThreadFactory threadFactory)
    -    {
    -        this(client, path, cacheData, dataIsCompressed, new CloseableExecutorService(Executors.newSingleThreadExecutor(threadFactory),
true));
    -    }
    -
    -    /**
    -     * @param client           the client
    -     * @param path             path to watch
    -     * @param cacheData        if true, node contents are cached in addition to the stat
    -     * @param dataIsCompressed if true, data in the path is compressed
    -     * @param executorService  ExecutorService to use for the TreeCache's background
thread
    +     * Create a TreeCache for the given client and path with default options.
    +     *
    +     * If the client is namespaced, all operations on the resulting TreeCache will be
in terms of
    +     * the namespace, including all published events.  The given path is the root at
which the
    +     * TreeCache will watch and explore.  If no node exists at the given path, the TreeCache
will
    +     * be initially empty.
    +     *
    +     * @see #newBuilder(CuratorFramework, String)
    +     * @param client the client to use; may be namespaced
    +     * @param path the path to the root node to watch/explore; this path need not actually
exist on
    +     *             the server
          */
    -    public TreeCache(CuratorFramework client, String path, boolean cacheData, boolean
dataIsCompressed, final ExecutorService executorService)
    +    public TreeCache(CuratorFramework client, String path)
    --- End diff --
    
    That makes sense. The added javadoc is probably enough to direct people towards the builder
if they need something more advanced, so unless this turns out to be an issue later, then
we don't need to worry about it.


> TreeCache should use a builder for advanced options
> ---------------------------------------------------
>
>                 Key: CURATOR-144
>                 URL: https://issues.apache.org/jira/browse/CURATOR-144
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Recipes
>            Reporter: Scott Blum
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message