Class TreeCache.Builder
java.lang.Object
org.apache.curator.framework.recipes.cache.TreeCache.Builder
- Enclosing class:
TreeCache
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theTreeCachebased on configured values.disableZkWatches(boolean disableZkWatches) By default, TreeCache createsZooKeeperwatches 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,DefaultTreeCacheSelectoris used.
-
Method Details
-
build
Builds theTreeCachebased 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. AmaxDepthof0will watch only the root node (likeNodeCache); amaxDepthof1will 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 createsZooKeeperwatches for every created path. Change this behavior with this method.- Parameters:
disableZkWatches- true to disable zk watches- Returns:
- this for chaining
-
setSelector
By default,DefaultTreeCacheSelectoris used. Change the selector here.- Parameters:
selector- new selector- Returns:
- this for chaining
-