Package org.apache.curator.framework

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


        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

            //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

        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

        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

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.