@Override public void delete(final String path, final int version) throws KeeperException { assertClusterIdFlagTrue(); final String namespace = emptyToNull(client.getNamespace()); final String namespacedPath = ZKPaths.fixForNamespace(namespace, path); try { client.getZookeeperClient().getZooKeeper().delete(namespacedPath, version); } catch (Exception e) { throwIfInstanceOf(e, KeeperException.class); throw new RuntimeException(e); } }
String fixForNamespace(String path, boolean isSequential) { if ( ensurePathNeeded.get() ) { try { final CuratorZookeeperClient zookeeperClient = client.getZookeeperClient(); RetryLoop.callWithRetry ( zookeeperClient, new Callable<Object>() { @Override public Object call() throws Exception { ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", namespace), true, client.getAclProvider(), true); return null; } } ); ensurePathNeeded.set(false); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); client.logError("Ensure path threw exception", e); } } return ZKPaths.fixForNamespace(namespace, path, isSequential); }
/** * Apply the namespace to the given path * * @param namespace namespace (can be null) * @param path path * @return adjusted path */ public static String fixForNamespace(String namespace, String path) { return fixForNamespace(namespace, path, false); }
/** * Apply the namespace to the given path * * @param namespace namespace (can be null) * @param path path * @return adjusted path */ public static String fixForNamespace(String namespace, String path) { return fixForNamespace(namespace, path, false); }
final String namespacedPath = ZKPaths.fixForNamespace(namespace, path);
@Override public void delete(final String path, final int version) throws KeeperException { assertClusterIdFlagTrue(); final String namespace = emptyToNull(client.getNamespace()); final String namespacedPath = ZKPaths.fixForNamespace(namespace, path); try { client.getZookeeperClient().getZooKeeper().delete(namespacedPath, version); } catch (Exception e) { propagateIfInstanceOf(e, KeeperException.class); throw propagate(e); } }
String fixForNamespace(String path, boolean isSequential) { if ( ensurePathNeeded.get() ) { try { final CuratorZookeeperClient zookeeperClient = client.getZookeeperClient(); RetryLoop.callWithRetry ( zookeeperClient, new Callable<Object>() { @Override public Object call() throws Exception { ZKPaths.mkdirs(zookeeperClient.getZooKeeper(), ZKPaths.makePath("/", namespace), true, client.getAclProvider(), true); return null; } } ); ensurePathNeeded.set(false); } catch ( Exception e ) { ThreadUtils.checkInterrupted(e); client.logError("Ensure path threw exception", e); } } return ZKPaths.fixForNamespace(namespace, path, isSequential); }