[
https://issues.apache.org/jira/browse/CURATOR-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14107490#comment-14107490
]
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_r16621651
--- 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 --
Is it confusing to have both a public constructor and a builder available?
I think I'd prefer to expose only the builder.
> 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)