in curator-framework/src/main/java/org/apache/curator/framework/imps/DeleteBuilderImpl.java [170:214]
public void performBackgroundOperation(final OperationAndData<String> operationAndData) throws Exception {
try {
final OperationTrace trace =
client.getZookeeperClient().startAdvancedTracer("DeleteBuilderImpl-Background");
client.getZooKeeper()
.delete(
operationAndData.getData(),
version,
new AsyncCallback.VoidCallback() {
@Override
public void processResult(int rc, String path, Object ctx) {
trace.setReturnCode(rc).setPath(path).commit();
if ((rc == KeeperException.Code.OK.intValue()) && failNextDeleteForTesting) {
failNextDeleteForTesting = false;
rc = KeeperException.Code.CONNECTIONLOSS.intValue();
}
if ((rc == KeeperException.Code.NOTEMPTY.intValue()) && deletingChildrenIfNeeded) {
backgroundDeleteChildrenThenNode(operationAndData);
} else {
if ((rc == KeeperException.Code.NONODE.intValue()) && quietly) {
rc = KeeperException.Code.OK.intValue();
}
CuratorEvent event = new CuratorEventImpl(
client,
CuratorEventType.DELETE,
rc,
path,
null,
ctx,
null,
null,
null,
null,
null,
null);
client.processBackgroundOperation(operationAndData, event);
}
}
},
backgrounding.getContext());
} catch (Throwable e) {
backgrounding.checkError(e, null);
}
}