Package org.apache.curator.framework.api.transaction

Examples of org.apache.curator.framework.api.transaction.CuratorTransactionFinal.commit()


    CuratorTransactionFinal tx =
        ZooKeeperUtils.buildAtomicRecursiveDelete(mZKClient, mZKClient.inTransaction(), "/foo");
    mZKClient.create().forPath("/foo/new-child");

    try {
      tx.commit();
    } catch (NotEmptyException nee) {
      // expected
    }
    Assert.assertNotNull(mZKClient.checkExists().forPath("/foo"));
  }
View Full Code Here


    CuratorTransactionFinal tx =
        ZooKeeperUtils.buildAtomicRecursiveDelete(mZKClient, mZKClient.inTransaction(), "/foo");
    mZKClient.delete().forPath(path);

    try {
      tx.commit(); // should throw
    } catch (NoNodeException nne) {
      // expected
    }
    Assert.assertNotNull(mZKClient.checkExists().forPath("/foo"));
  }
View Full Code Here

      }
      final CuratorTransactionFinal t = client.inTransaction().check().forPath(path).and();
      for (final String node : reverse(nodes))  {
        t.delete().forPath(node).and();
      }
      t.commit();
    } catch (Exception e) {
      propagateIfInstanceOf(e, KeeperException.class);
      throw propagate(e);
    }
  }
View Full Code Here

      }
    }

    // Commit
    try {
      return transaction.commit();
    } catch (Exception e) {
      propagateIfInstanceOf(e, KeeperException.class);
      throw propagate(e);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.