Examples of checkExists()


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

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

            readBytes = client.getData().forPath("/test");
            Assert.assertEquals(writtenBytes, readBytes);
            Stat    stat = client.checkExists().forPath("/ghost");
            Assert.assertNull(stat);

            String  realPath = client.create().withMode(CreateMode.PERSISTENT_SEQUENTIAL).forPath("/pseq", writtenBytes);
            Assert.assertNotSame(realPath, "/pseq");
View Full Code Here

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

            client.close();
            client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
            client.start();

            stat = client.checkExists().forPath(realPath);
            Assert.assertNull(stat);
        }
        finally
        {
            client.close();
View Full Code Here

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

            catch ( KeeperException.BadVersionException correct )
            {
                // correct
            }
           
            Assert.assertNull(client.checkExists().forPath("/bar"));
        }
        finally
        {
            client.close();
        }
View Full Code Here

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

                .and()
                    .delete().forPath("/foo/bar")
                .and()
                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo") != null);
            Assert.assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
            Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes());
            Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null);

            CuratorTransactionResult    ephemeralResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
View Full Code Here

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

                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo") != null);
            Assert.assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
            Assert.assertEquals(client.getData().forPath("/foo"), "two".getBytes());
            Assert.assertTrue(client.checkExists().forPath("/foo/bar") == null);

            CuratorTransactionResult    ephemeralResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
            Assert.assertNotNull(ephemeralResult);
            Assert.assertNotEquals(ephemeralResult.getResultPath(), "/test-");
            Assert.assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
View Full Code Here

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

                .and()
                    .create().forPath("/foo/bar", "snafu".getBytes())
                .and()
                    .commit();

            Assert.assertTrue(client.checkExists().forPath("/foo/bar") != null);
            Assert.assertEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());

            CuratorTransactionResult    fooResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
            CuratorTransactionResult    fooBarResult = Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
            Assert.assertNotNull(fooResult);
View Full Code Here

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

            client.start();

            client.create().forPath("/one");
            Assert.assertNotNull(client.getZookeeperClient().getZooKeeper().exists("/one", false));

            Assert.assertNotNull(client.checkExists().forPath("/"));
            try
            {
                client.checkExists().forPath("");
                Assert.fail("IllegalArgumentException expected");
            }
View Full Code Here

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

            Assert.assertNotNull(client.getZookeeperClient().getZooKeeper().exists("/one", false));

            Assert.assertNotNull(client.checkExists().forPath("/"));
            try
            {
                client.checkExists().forPath("");
                Assert.fail("IllegalArgumentException expected");
            }
            catch ( IllegalArgumentException expected )
            {
            }
View Full Code Here

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

        {
            cluster.start();

            client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(100));
            client.start();
            client.checkExists().forPath("/");
            client.close();
            client = null;

            Iterator<InstanceSpec> iterator = cluster.getInstances().iterator();
            for ( int i = 0; i < 2; ++i )
View Full Code Here

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

                    }
                }
            );
            client.start();

            client.checkExists().forPath("/");

            ConnectionState state = states.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS);
            Assert.assertEquals(state, ConnectionState.READ_ONLY);
        }
        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.