Class TreeCache.Builder
java.lang.Object
org.apache.curator.framework.recipes.cache.TreeCache.Builder
- Enclosing class:
TreeCache
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theTreeCache
based on configured values.disableZkWatches
(boolean disableZkWatches) By default, TreeCache createsZooKeeper
watches for every created path.setCacheData
(boolean cacheData) Sets whether or not to cache byte data per node; defaulttrue
.setCreateParentNodes
(boolean createParentNodes) By default, TreeCache does not auto-create parent nodes for the cached path.setDataIsCompressed
(boolean dataIsCompressed) Sets whether or to decompress node data; defaultfalse
.setExecutor
(ExecutorService executorService) Sets the executor to publish events; a default executor will be created if not specified.setExecutor
(ThreadFactory threadFactory) Sets the executor to publish events; a default executor will be created if not specified.setMaxDepth
(int maxDepth) Sets the maximum depth to explore/watch.setSelector
(TreeCacheSelector selector) By default,DefaultTreeCacheSelector
is used.
-
Method Details
-
build
Builds theTreeCache
based on configured values. -
setCacheData
Sets whether or not to cache byte data per node; defaulttrue
. -
setDataIsCompressed
Sets whether or to decompress node data; defaultfalse
. -
setExecutor
Sets the executor to publish events; a default executor will be created if not specified. -
setExecutor
Sets the executor to publish events; a default executor will be created if not specified. -
setMaxDepth
Sets the maximum depth to explore/watch. AmaxDepth
of0
will watch only the root node (likeNodeCache
); amaxDepth
of1
will watch the root node and its immediate children (kind of likePathChildrenCache
. Default:Integer.MAX_VALUE
-
setCreateParentNodes
By default, TreeCache does not auto-create parent nodes for the cached path. Change this behavior with this method. NOTE: parent nodes are created as containers- Parameters:
createParentNodes
- true to create parent nodes- Returns:
- this for chaining
-
disableZkWatches
By default, TreeCache createsZooKeeper
watches for every created path. Change this behavior with this method.- Parameters:
disableZkWatches
- true to disable zk watches- Returns:
- this for chaining
-
setSelector
By default,DefaultTreeCacheSelector
is used. Change the selector here.- Parameters:
selector
- new selector- Returns:
- this for chaining
-