return version;
}
private void pathInForeground(final String path, String unfixedPath) throws Exception
{
TimeTrace trace = client.getZookeeperClient().startTracer("DeleteBuilderImpl-Foreground");
try
{
RetryLoop.callWithRetry
(
client.getZookeeperClient(),
new Callable<Void>()
{
@Override
public Void call() throws Exception
{
try {
client.getZooKeeper().delete(path, version);
} catch (KeeperException.NotEmptyException e) {
if (deletingChildrenIfNeeded) {
ZKPaths.deleteChildren(client.getZooKeeper(), path, true);
} else {
throw e;
}
}
return null;
}
}
);
}
catch ( KeeperException.NodeExistsException e )
{
throw e;
}
catch ( Exception e )
{
if ( guaranteed )
{
client.getFailedDeleteManager().addFailedDelete(unfixedPath);
}
throw e;
}
trace.commit();
}