private void remvBusinessStageRollbackFlag(TransactionXid transactionXid) { String global = ByteUtils.byteArrayToString(transactionXid.getGlobalTransactionId()); String parent = String.format("%s/%s/rollback", CONSTANTS_ROOT_PATH, CommonUtils.getApplication(this.endpoint)); String target = String.format("%s/%s", parent, global); try { this.curatorFramework.delete().inBackground(this).forPath(target); } catch (Exception error) { logger.warn("Error occurred while deleting zookeeper path({}).", target); } }
meta.setHost(address); configClient.delete().inBackground(new BackgroundCallback() {
meta.setHost(address); configClient.delete().inBackground(new BackgroundCallback() {
void deleteTask(String number) throws Exception { LOG.info("Deleting task: {}", number); client.delete().inBackground().forPath("/tasks/task-" + number); recoveryLatch.countDown(); }
void deleteAssignment(String path) throws Exception { /* * Delete assignment */ LOG.info( "Deleting assignment: {}", path ); client.delete().inBackground().forPath(path); }
void deleteTask(String number) throws Exception { LOG.info("Deleting task: {}", number); client.delete().inBackground().forPath("/tasks/task-" + number); recoveryLatch.countDown(); }
void deleteAssignment(String path) throws Exception { /* * Delete assignment */ LOG.info( "Deleting assignment: {}", path ); client.delete().inBackground().forPath(path); }
void deleteAssignment(String path) throws Exception { /* * Delete assignment */ LOG.info( "Deleting assignment: {}", path ); client.delete().inBackground().forPath(path); }
void deleteTask(String number) throws Exception { LOG.info("Deleting task: {}", number); client.delete().inBackground().forPath("/tasks/task-" + number); recoveryLatch.countDown(); }
@Override public ErrorListenerPathable<Void> inBackground() { return new ErrorListenerPathableDecorator<>(inner.inBackground()); }
@Override public ErrorListenerPathable<Void> inBackground(Object context) { return new ErrorListenerPathableDecorator<>(inner.inBackground(context)); }
CompletableFuture<Void> deleteNode(final String path) { final CompletableFuture<Void> result = new CompletableFuture<>(); try { client.delete().inBackground( callback(x -> result.complete(null), result::completeExceptionally, path), executor).forPath(path); } catch (Exception e) { result.completeExceptionally(StoreException.create(StoreException.Type.UNKNOWN, e, path)); } return result; }
@Override public ErrorListenerPathable<Void> inBackground(BackgroundCallback callback, Object context) { return new ErrorListenerPathableDecorator<>(inner.inBackground(wrap(callback), context, executor)); }
@Override public ErrorListenerPathable<Void> inBackground(BackgroundCallback callback, Executor executor) { return new ErrorListenerPathableDecorator<>(inner.inBackground(wrap(callback), executor)); }
@Override public ErrorListenerPathable<Void> inBackground(BackgroundCallback callback) { return new ErrorListenerPathableDecorator<>(inner.inBackground(wrap(callback), executor)); }
@Override public ErrorListenerPathable<Void> inBackground(BackgroundCallback callback, Object context, Executor executor) { return new ErrorListenerPathableDecorator<>(inner.inBackground(wrap(callback), context, executor)); }
private CompletableFuture<Void> deleteNode(String path) { CompletableFuture<Void> result = new CompletableFuture<>(); try { client.delete().inBackground((cli, event) -> { if (event.getResultCode() == KeeperException.Code.OK.intValue() || event.getResultCode() == KeeperException.Code.NONODE.intValue()) { result.complete(null); } else { result.completeExceptionally(translateErrorCode(path, event)); } }, executor).forPath(path); } catch (Exception e) { result.completeExceptionally(StoreException.create(StoreException.Type.UNKNOWN, e)); } return result; }
delete.inBackground(backgroundCallback);
Future<V> delete(String path, V v) { Future<V> future = Future.future(); try { curator.delete().deletingChildrenIfNeeded().inBackground((client, event) -> { if (event.getType() == CuratorEventType.DELETE) { //clean parent node if doesn't have child node. String[] paths = path.split("/"); String parentNodePath = Stream.of(paths).limit(paths.length - 1).reduce((previous, current) -> previous + "/" + current).get(); curator.getChildren().inBackground((childClient, childEvent) -> { if (childEvent.getChildren().size() == 0) { curator.delete().inBackground((deleteClient, deleteEvent) -> { if (deleteEvent.getType() == CuratorEventType.DELETE) vertx.runOnContext(ea -> future.complete(v)); }).forPath(parentNodePath); } else { vertx.runOnContext(ea -> future.complete(v)); } }).forPath(parentNodePath); } }).forPath(path); } catch (Exception ex) { vertx.runOnContext(aVoid -> future.fail(ex)); } return future; } }
delete.inBackground(backgroundCallback);