Package org.apache.curator.framework

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


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

            final CountDownLatch latch = new CountDownLatch(3);
            final List<String> paths = Lists.newArrayList();
            BackgroundCallback callback = new BackgroundCallback()
            {
View Full Code Here


            .sessionTimeoutMs(60000)
            .retryPolicy(new RetryNTimes(1, 1000)).build();
        final CountDownLatch latch = new CountDownLatch(1);
        try
        {
            client.start();
            BackgroundCallback curatorCallback = new BackgroundCallback()
            {

                @Override
                public void processResult(CuratorFramework client, CuratorEvent event)
View Full Code Here

  @Override
  protected FlumeConfiguration getFlumeConfiguration() {
    try {
      CuratorFramework cf = createClient();
      cf.start();
      try {
        byte[] data = cf.getData().forPath(basePath + "/" + getAgentName());
        return configFromBytes(data);
      } finally {
        cf.close();
View Full Code Here

        }

        @Override
        public CuratorFramework get() {
            CuratorFramework client = CuratorFrameworkFactory.newClient(zookeeperConnectionString, retryPolicy);
            client.start();
            return client;
        }
    }

    private <T> Provider<T> getConfigurableProvider(final Configuration config, final String key) {
View Full Code Here

        return newCurator(conf, servers, port, "");
    }

    public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root) {
        CuratorFramework ret = newCurator(conf, servers, port, root);
        ret.start();
        return ret;
    }
   
    public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port) {
        CuratorFramework ret = newCurator(conf, servers, port);
View Full Code Here

        return ret;
    }
   
    public static CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port) {
        CuratorFramework ret = newCurator(conf, servers, port);
        ret.start();
        return ret;
    }   
   
    /**
     *
 
View Full Code Here

{
    @Test
    public void     testCheckVersion() throws Exception
    {
        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        client.start();
        try
        {
            client.create().forPath("/foo");
            Stat        stat = client.setData().forPath("/foo", "new".getBytes())// up the version
View Full Code Here

    @Test
    public void     testWithNamespace() throws Exception
    {
        CuratorFramework        client = CuratorFrameworkFactory.builder().connectString(server.getConnectString()).retryPolicy(new RetryOneTime(1)).namespace("galt").build();
        client.start();
        try
        {
            Collection<CuratorTransactionResult>    results =
                client.inTransaction()
                    .create().forPath("/foo", "one".getBytes())
View Full Code Here

    @Test
    public void     testBasic() throws Exception
    {
        CuratorFramework        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        client.start();
        try
        {
            Collection<CuratorTransactionResult>    results =
                client.inTransaction()
                    .create().forPath("/foo")
View Full Code Here

    public void     testSimultaneous() throws Exception
    {
        CuratorFramework    client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
        try
        {
            client.start();

            CuratorFramework fooClient = client.usingNamespace("foo");
            CuratorFramework barClient = client.usingNamespace("bar");

            fooClient.create().forPath("/one");
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.