/** * Add a path to reap children from * * @param path the path * @return this for chaining */ public ChildReaper addPath(String path) { paths.add(PathUtils.validatePath(path)); return this; }
/** * Remove a path from reaping * * @param path the path * @return true if the path existed and was removed */ public boolean removePath(String path) { return paths.remove(PathUtils.validatePath(path)); }
@Override /** {@inheritDoc} */ public void ensurePath(final String path, final boolean excludingLast) throws KeeperException { PathUtils.validatePath(path); assertClusterIdFlagTrue(); final String[] parts = path.substring(1).split(Pattern.quote("/")); final int end = excludingLast ? parts.length - 1 : parts.length; String current = ""; for (int i = 0; i < end; i++) { current += "/" + parts[i]; if (exists(current) == null) { create(current); } } }
PathUtils.validatePath(zkRootPath);
NamespaceImpl(CuratorFrameworkImpl client, String namespace) { if ( namespace != null ) { try { PathUtils.validatePath("/" + namespace); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException("Invalid namespace: " + namespace + ", " + e.getMessage()); } } this.client = client; this.namespace = namespace; ensurePathNeeded = new AtomicBoolean(namespace != null); }
/** validate the provided znode path string * @param path znode path string * @param isSequential if the path is being created * with a sequential flag * @throws IllegalArgumentException if the path is invalid */ public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException { validatePath(isSequential? path + "1": path); }
/** * @param client curztor client * @param path the full path to the node to cache * @param dataIsCompressed if true, data in the path is compressed */ public NodeCache(CuratorFramework client, String path, boolean dataIsCompressed) { this.client = client; this.path = PathUtils.validatePath(path); this.dataIsCompressed = dataIsCompressed; }
ChildrenCache(CuratorFramework client, String path) { this.client = client; this.path = PathUtils.validatePath(path); }
QueueSafety(String lockPath, BlockingQueue<T> queue) { this.lockPath = PathUtils.validatePath(lockPath); this.consumer = null; this.queue = queue; }
/** validate the provided znode path string * @param path znode path string * @param isSequential if the path is being created * with a sequential flag * @throws IllegalArgumentException if the path is invalid */ public static void validatePath(String path, boolean isSequential) throws IllegalArgumentException { validatePath(isSequential? path + "1": path); }
GetDataOperation(PathChildrenCache cache, String fullPath) { this.cache = cache; this.fullPath = PathUtils.validatePath(fullPath); }
/** * Add a path to reap children from * * @param path the path * @return this for chaining */ public ChildReaper addPath(String path) { paths.add(PathUtils.validatePath(path)); return this; }
/** * Remove a path from reaping * * @param path the path * @return true if the path existed and was removed */ public boolean removePath(String path) { return paths.remove(PathUtils.validatePath(path)); }
private Builder(CuratorFramework client, String path) { this.client = checkNotNull(client); this.path = validatePath(path); }
/** * Add a path to reap children from * * @param path the path * @return this for chaining */ public ChildReaper addPath(String path) { paths.add(PathUtils.validatePath(path)); return this; }
private QueueBuilder(CuratorFramework client, QueueConsumer<T> consumer, QueueSerializer<T> serializer, String queuePath) { this.client = client; this.consumer = consumer; this.serializer = serializer; this.queuePath = PathUtils.validatePath(queuePath); factory = defaultThreadFactory; executor = MoreExecutors.directExecutor(); } }
public ZookeeperCuratorLockProvider(CuratorFramework client, String path) { this.client = requireNonNull(client); this.path = PathUtils.validatePath(path); }
/** * Add a path to reap children from * * @param path the path * @return this for chaining */ public ChildReaper addPath(String path) { paths.add(PathUtils.validatePath(path)); return this; }
/** * Remove a path from reaping * * @param path the path * @return true if the path existed and was removed */ public boolean removePath(String path) { return paths.remove(PathUtils.validatePath(path)); }
/** * Add a path to reap children from * * @param path the path * @return this for chaining */ public ChildReaper addPath(String path) { paths.add(PathUtils.validatePath(path)); return this; }