Modifier and Type | Method and Description |
---|---|
TreeCache |
build()
Builds the
TreeCache based on configured values. |
TreeCache.Builder |
disableZkWatches(boolean disableZkWatches)
By default, TreeCache creates
ZooKeeper watches for every created path. |
TreeCache.Builder |
setCacheData(boolean cacheData)
Sets whether or not to cache byte data per node; default
true . |
TreeCache.Builder |
setCreateParentNodes(boolean createParentNodes)
By default, TreeCache does not auto-create parent nodes for the cached path.
|
TreeCache.Builder |
setDataIsCompressed(boolean dataIsCompressed)
Sets whether or to decompress node data; default
false . |
TreeCache.Builder |
setExecutor(ExecutorService executorService)
Sets the executor to publish events; a default executor will be created if not specified.
|
TreeCache.Builder |
setExecutor(ThreadFactory threadFactory)
Sets the executor to publish events; a default executor will be created if not specified.
|
TreeCache.Builder |
setMaxDepth(int maxDepth)
Sets the maximum depth to explore/watch.
|
TreeCache.Builder |
setSelector(TreeCacheSelector selector)
By default,
DefaultTreeCacheSelector is used. |
public TreeCache.Builder setCacheData(boolean cacheData)
true
.public TreeCache.Builder setDataIsCompressed(boolean dataIsCompressed)
false
.public TreeCache.Builder setExecutor(ThreadFactory threadFactory)
public TreeCache.Builder setExecutor(ExecutorService executorService)
public TreeCache.Builder setMaxDepth(int maxDepth)
maxDepth
of 0
will watch only
the root node (like NodeCache
); a maxDepth
of 1
will watch the
root node and its immediate children (kind of like PathChildrenCache
.
Default: Integer.MAX_VALUE
public TreeCache.Builder setCreateParentNodes(boolean createParentNodes)
createParentNodes
- true to create parent nodespublic TreeCache.Builder disableZkWatches(boolean disableZkWatches)
ZooKeeper
watches for every created path.
Change this behavior with this method.disableZkWatches
- true to disable zk watchespublic TreeCache.Builder setSelector(TreeCacheSelector selector)
DefaultTreeCacheSelector
is used. Change the selector here.selector
- new selectorCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.