Examples of inTransaction()


Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        client.start();
        try
        {
            Collection<CuratorTransactionResult>    results =
                client.inTransaction()
                    .create().forPath("/foo")
                .and()
                    .create().forPath("/foo/bar", "snafu".getBytes())
                .and()
                    .commit();
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

        try
        {
            client.start();

            //Create uncompressed data in a transaction
            client.inTransaction().create().forPath(path, data).and().commit();
            Assert.assertEquals(data, client.getData().forPath(path));

            //Create compressed data in transaction
            client.inTransaction().setData().compressed().forPath(path, data).and().commit();
            Assert.assertEquals(data, client.getData().decompressed().forPath(path));
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

            //Create uncompressed data in a transaction
            client.inTransaction().create().forPath(path, data).and().commit();
            Assert.assertEquals(data, client.getData().forPath(path));

            //Create compressed data in transaction
            client.inTransaction().setData().compressed().forPath(path, data).and().commit();
            Assert.assertEquals(data, client.getData().decompressed().forPath(path));
        }
        finally
        {
            CloseableUtils.closeQuietly(client);
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

        try
        {
            client.start();

            //Create the nodes
            client.inTransaction().create().compressed().forPath(path1).and().
            create().forPath(path2).and().commit();

            //Check they exist
            Assert.assertNotNull(client.checkExists().forPath(path1));
            Assert.assertNotNull(client.checkExists().forPath(path2));
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

            //Check they exist
            Assert.assertNotNull(client.checkExists().forPath(path1));
            Assert.assertNotNull(client.checkExists().forPath(path2));
           
            //Set the nodes, path1 compressed, path2 uncompressed.
            client.inTransaction().setData().compressed().forPath(path1, data1).and().
            setData().forPath(path2, data2).and().commit();
           
            Assert.assertNotEquals(data1, client.getData().forPath(path1));
            Assert.assertEquals(data1, client.getData().decompressed().forPath(path1));
     
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        try
        {
            client.start();

            client.inTransaction().create().compressed().forPath(path1, data1).and().
            create().compressed().forPath(path2, data2).and().commit();

            Assert.assertNotEquals(data1, client.getData().forPath(path1));
            Assert.assertEquals(data1, client.getData().decompressed().forPath(path1));
           
View Full Code Here

Examples of org.apache.curator.framework.CuratorFramework.inTransaction()

        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        try
        {
            client.start();

            client.inTransaction().create().compressed().forPath(path1, data1).and().
            create().forPath(path2, data2).and().commit();

            Assert.assertNotEquals(data1, client.getData().forPath(path1));
            Assert.assertEquals(data1, client.getData().decompressed().forPath(path1));
     
View Full Code Here

Examples of org.apache.curator.framework.CuratorTempFramework.inTransaction()

    public void testBasic() throws Exception
    {
        CuratorTempFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).buildTemp();
        try
        {
            client.inTransaction().create().forPath("/foo", "data".getBytes()).and().commit();

            byte[] bytes = client.getData().forPath("/foo");
            Assert.assertEquals(bytes, "data".getBytes());
        }
        finally
View Full Code Here

Examples of org.apache.curator.framework.CuratorTempFramework.inTransaction()

    public void testBasic() throws Exception
    {
        CuratorTempFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).buildTemp();
        try
        {
            client.inTransaction().create().forPath("/foo", "data".getBytes()).and().commit();

            byte[] bytes = client.getData().forPath("/foo");
            Assert.assertEquals(bytes, "data".getBytes());
        }
        finally
View Full Code Here

Examples of org.apache.curator.framework.CuratorTempFramework.inTransaction()

    public void testBasic() throws Exception
    {
        CuratorTempFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).buildTemp();
        try
        {
            client.inTransaction().create().forPath("/foo", "data".getBytes()).and().commit();

            byte[] bytes = client.getData().forPath("/foo");
            Assert.assertEquals(bytes, "data".getBytes());
        }
        finally
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.