Class TreeCache.Builder

  • Enclosing class:
    TreeCache

    public static final class TreeCache.Builder
    extends java.lang.Object
    • Method Detail

      • setCacheData

        public TreeCache.Builder setCacheData​(boolean cacheData)
        Sets whether or not to cache byte data per node; default true.
      • setDataIsCompressed

        public TreeCache.Builder setDataIsCompressed​(boolean dataIsCompressed)
        Sets whether or to decompress node data; default false.
      • setExecutor

        public TreeCache.Builder setExecutor​(java.util.concurrent.ThreadFactory threadFactory)
        Sets the executor to publish events; a default executor will be created if not specified.
      • setExecutor

        public TreeCache.Builder setExecutor​(java.util.concurrent.ExecutorService executorService)
        Sets the executor to publish events; a default executor will be created if not specified.
      • setMaxDepth

        public TreeCache.Builder setMaxDepth​(int maxDepth)
        Sets the maximum depth to explore/watch. A 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
      • setCreateParentNodes

        public TreeCache.Builder setCreateParentNodes​(boolean createParentNodes)
        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

        public TreeCache.Builder disableZkWatches​(boolean disableZkWatches)
        By default, TreeCache creates ZooKeeper watches for every created path. Change this behavior with this method.
        Parameters:
        disableZkWatches - true to disable zk watches
        Returns:
        this for chaining