Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA2AB11639 for ; Fri, 22 Aug 2014 21:16:18 +0000 (UTC) Received: (qmail 88343 invoked by uid 500); 22 Aug 2014 21:16:18 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 88299 invoked by uid 500); 22 Aug 2014 21:16:18 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 88288 invoked by uid 99); 22 Aug 2014 21:16:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2014 21:16:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 21D4C9C8B2C; Fri, 22 Aug 2014 21:16:14 +0000 (UTC) From: dragonsinth To: dev@curator.apache.org Reply-To: dev@curator.apache.org References: In-Reply-To: Subject: [GitHub] curator pull request: CURATOR-144: TreeCache.Builder to configure ... Content-Type: text/plain Message-Id: <20140822211617.21D4C9C8B2C@tyr.zones.apache.org> Date: Fri, 22 Aug 2014 21:16:14 +0000 (UTC) Github user dragonsinth commented on a diff in the pull request: https://github.com/apache/curator/pull/41#discussion_r16621936 --- 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 -- It's a convenience for the happy path where you don't need any extra options. `new TreeCache(client, "/")` vs. `TreeCache.newBuilder(client, "/").build()` --- 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. ---