@Override public void run() { logIfFailed(zkClient.delete(path, version)); } };
@Override public void run() { logIfFailed(zkClient.delete(path, version)); } };
@Override public OperationFuture<String> delete(String deletePath, int version) { return delegate.delete(deletePath, version); }
@Override public OperationFuture<String> delete(String deletePath, int version) { return client.delete(deletePath, version); }
@Override public OperationFuture<String> delete(String deletePath, int version) { return client.delete(deletePath, version); }
@Override public OperationFuture<String> delete(String deletePath, int version) { return delegate.delete(deletePath, version); }
@Override public void run() { try { future.get(); } catch (Exception e) { zkClient.delete(node); } } }, Threads.SAME_THREAD_EXECUTOR);
/** * Removes the {@link ResourceAssignment} with the given name from local cache as well as ZK. * @param name Name of the resource. */ private void removeAssignment(String name) { assignments.remove(name); String zkPath = CoordinationConstants.ASSIGNMENTS_PATH + "/" + name; // Simply delete the assignment node. No need to care about the result. // Even if failed to delete the node and leaves stale assignment, next time when an assignment action is // triggered, it'll correct it. zkClient.delete(zkPath); }
/** * Removes the {@link ResourceAssignment} with the given name from local cache as well as ZK. * @param name Name of the resource. */ private void removeAssignment(String name) { assignments.remove(name); String zkPath = CoordinationConstants.ASSIGNMENTS_PATH + "/" + name; // Simply delete the assignment node. No need to care about the result. // Even if failed to delete the node and leaves stale assignment, next time when an assignment action is // triggered, it'll correct it. zkClient.delete(zkPath); }
@Override public void run() { try { future.get(); } catch (Exception e) { zkClient.delete(node); } } }, Threads.SAME_THREAD_EXECUTOR);
@Override public void run() { try { future.get(); } catch (Exception e) { zkClient.delete(node); } } }, Threads.SAME_THREAD_EXECUTOR);
/** * Acts as {@link ZKClient#delete(String)} if passed {@code ignoreIfAbsent} param is false. * Otherwise the same way but doesn't throw exception if node doesn't exists. * In latter case sets {@code null} in returned future. */ public static ListenableFuture<String> delete(final ZKClient zkClient, final String path, final int version, boolean ignoreIfAbsent) { if (!ignoreIfAbsent) { return zkClient.delete(path, version); } return ignoreError(zkClient.delete(path, version), KeeperException.NoNodeException.class); }
/** * Deletes the {@link ResourceRequirement} for the given resource. * * @param resourceName Name of the resource. * @return A {@link ListenableFuture} that will be completed when the requirement is successfully removed. * If the requirement doesn't exists, the deletion would still be treated as successful. */ public ListenableFuture<String> deleteRequirement(String resourceName) { String zkPath = CoordinationConstants.REQUIREMENTS_PATH + "/" + resourceName; return Futures.transform( ZKOperations.ignoreError(zkClient.delete(zkPath), KeeperException.NoNodeException.class, resourceName), Functions.constant(resourceName) ); }
@Override public void delete(final ProgramId serviceId) throws NotFoundException { OperationFuture<String> future = zkClient.delete(getZKPath(serviceId)); SettableFuture<RouteConfig> oldConfigFuture = routeConfigMap.get(serviceId); try { future.get(ZK_TIMEOUT_SECS, TimeUnit.SECONDS); routeConfigMap.remove(serviceId, oldConfigFuture); } catch (ExecutionException | InterruptedException | TimeoutException ex) { if (ex.getCause() instanceof KeeperException.NoNodeException) { throw new NotFoundException(String.format("Route Config for Service %s was not found.", serviceId)); } throw Throwables.propagate(ex); } }
@Override public void delete(final ProgramId serviceId) throws NotFoundException { OperationFuture<String> future = zkClient.delete(getZKPath(serviceId)); SettableFuture<RouteConfig> oldConfigFuture = routeConfigMap.get(serviceId); try { future.get(ZK_TIMEOUT_SECS, TimeUnit.SECONDS); routeConfigMap.remove(serviceId, oldConfigFuture); } catch (ExecutionException | InterruptedException | TimeoutException ex) { if (ex.getCause() instanceof KeeperException.NoNodeException) { throw new NotFoundException(String.format("Route Config for Service %s was not found.", serviceId)); } throw Throwables.propagate(ex); } }
/** * Deletes the {@link ResourceRequirement} for the given resource. * * @param resourceName Name of the resource. * @return A {@link ListenableFuture} that will be completed when the requirement is successfully removed. * If the requirement doesn't exists, the deletion would still be treated as successful. */ public ListenableFuture<String> deleteRequirement(String resourceName) { String zkPath = CoordinationConstants.REQUIREMENTS_PATH + "/" + resourceName; return Futures.transform( ZKOperations.ignoreError(zkClient.delete(zkPath), KeeperException.NoNodeException.class, resourceName), Functions.constant(resourceName) ); }
private OperationFuture<String> removeLiveNode() { String liveNode = getLiveNodePath(); LOG.info("Remove live node {}{}", zkClient.getConnectString(), liveNode); return ZKOperations.ignoreError(zkClient.delete(liveNode), KeeperException.NoNodeException.class, liveNode); }
private OperationFuture<String> removeLiveNode() { String liveNode = getLiveNodePath(); LOG.info("Remove live node {}{}", zkClient.getConnectString(), liveNode); return ZKOperations.ignoreError(zkClient.delete(liveNode), KeeperException.NoNodeException.class, liveNode); }
@Override public OperationFuture<String> delete(String deletePath, int version) { return relayPath(delegate.delete(getNamespacedPath(deletePath), version), this.<String>createFuture(deletePath)); }
@Override public OperationFuture<String> delete(String deletePath, int version) { return relayPath(delegate.delete(getNamespacedPath(deletePath), version), this.<String>createFuture(deletePath)); }