public void performBackgroundOperation(OperationAndData <PathAndBytes> operationAndData) { try { TimeTrace trace = client.getZookeeperClient().startTracer("SetDataBuilderImpl-Background"); object taskCtx = backgrounding.getContext(); Task <Stat> task = client.getZooKeeper().setDataAsync ( operationAndData.getData().getPath(), operationAndData.getData().getData(), version //, // new AsyncCallback.StatCallback() // { // public void processResult(int rc, String path, Object ctx, Stat stat) // { // trace.commit(); // ICuratorEvent @event = new CuratorEventImpl(client, CuratorEventType.SET_DATA, rc, path, null, ctx, stat, null, null, null, null); // client.processBackgroundOperation(operationAndData, @event); // }; // }, // backgrounding.getContext() ); task.ContinueWith(statTask => { trace.commit(); int errorCode = 0; if (statTask.IsFaulted) { if (!(statTask.Exception.InnerException is KeeperException)) { throw new Exception($"{nameof(SetDataBuilderImpl)}." + $"{nameof(performBackgroundOperation)} operation failed " + $"with unexpected exception of type " + $"{statTask.Exception.InnerException.GetType().FullName}." + $"Expected type {nameof(KeeperException)}"); } KeeperException keeperException = (KeeperException)statTask.Exception.InnerException; errorCode = (int)keeperException.getCode(); } ICuratorEvent @event = new CuratorEventImpl(client, CuratorEventType.SET_DATA, errorCode, operationAndData.getData().getPath(), null, taskCtx, statTask.Result, null, null, null, null); client.processBackgroundOperation(operationAndData, @event); }); } catch (Exception e) { backgrounding.checkError(e); } }
public void performBackgroundOperation(OperationAndData <PathAndBytes> operationAndData) { try { TimeTrace trace = client.getZookeeperClient().startTracer("CreateBuilderImpl-Background"); client.getZooKeeper().create ( operationAndData.getData().getPath(), operationAndData.getData().getData(), acling.getAclList(operationAndData.getData().getPath()), createMode, new AsyncCallback.StringCallback() { @Override
public void performBackgroundOperation(OperationAndData <String> operationAndData) { TimeTrace trace = client.getZookeeperClient().startTracer("BackgroundSyncImpl"); client.getZooKeeper().sync ( operationAndData.getData(), new AsyncCallback.VoidCallback() { @Override
public void performBackgroundOperation(OperationAndData <String> operationAndData) { try { TimeTrace trace = client.getZookeeperClient().startTracer("SyncBuilderImpl-Background"); String path = operationAndData.getData(); String adjustedPath = client.fixForNamespace(path); AsyncCallback.VoidCallback voidCallback = new AsyncCallback.VoidCallback() {
public void performBackgroundOperation(OperationAndData <String> operationAndData) { try { TimeTrace trace = client.getZookeeperClient().startTracer("DeleteBuilderImpl-Background"); client.getZooKeeper().delete ( operationAndData.getData(), version, new AsyncCallback.VoidCallback() { @Override
public void performBackgroundOperation(OperationAndData <String> operationAndData) { try { TimeTrace trace = client.getZookeeperClient().startTracer("SetACLBuilderImpl-Background"); String path = operationAndData.getData(); client.getZooKeeper().setACL ( path, acling.getAclList(path), version, new AsyncCallback.StatCallback() {