Package com.netflix.curator.framework

Examples of com.netflix.curator.framework.CuratorFramework.start()


        CalculatorConfiguration config = ConfigurationFactory
                .forClass(CalculatorConfiguration.class, new Validator())
                .build(new File(args[0]));

        CuratorFramework curator = config.getZooKeeperConfiguration().newCurator();
        curator.start();

        // Connection caching is optional, but included here for the sake of demonstration.
        ServiceCachingPolicy cachingPolicy = new ServiceCachingPolicyBuilder()
                .withMaxNumServiceInstances(10)
                .withMaxNumServiceInstancesPerEndPoint(1)
View Full Code Here


        CalculatorConfiguration config = ConfigurationFactory
                .forClass(CalculatorConfiguration.class, new Validator())
                .build(new File(args[0]));

        CuratorFramework curator = config.getZooKeeperConfiguration().newCurator();
        curator.start();

        // Connection caching is optional, but included here for the sake of demonstration.
        ServiceCachingPolicy cachingPolicy = new ServiceCachingPolicyBuilder()
                .withMaxNumServiceInstances(10)
                .withMaxNumServiceInstancesPerEndPoint(1)
View Full Code Here

    }

    public static IZkConnection createZkConnection(String connectString) {
        Timing                  timing = new Timing();
        CuratorFramework        client = CuratorFrameworkFactory.newClient(connectString, timing.session(), timing.connection(), new RetryOneTime(1));
        client.start();
        try
        {
            return new CuratorZKClientBridge(client);
        }
        catch ( Exception e )
View Full Code Here

    public CuratorFramework newCurator(CuratorFrameworkFactory.Builder builder) throws Exception {
        assertNotNull("ZooKeeper testing server is null, did you forget to call super.setup()", _zooKeeperServer);

        CuratorFramework curator = builder.connectString(_instanceSpec.getConnectString()).build();
        curator.start();

        _curatorInstances.add(curator);

        return curator;
    }
View Full Code Here

        CuratorFramework client = CuratorFrameworkFactory.newClient(ensemble,
                DynamicPropertyFactory.getInstance().getIntProperty("zookeeper.session.timeout", Integer.MIN_VALUE).get(),
                DynamicPropertyFactory.getInstance().getIntProperty("zookeeper.connection.timeout", Integer.MIN_VALUE).get(),
                new ExponentialBackoffRetry(1000, 3));
      
        client.start();

        cache.put(ensemble, new ZooKeeperClientCacheItem(ensemble, client));

        logger.info("Created, started, and cached zk client [{}] for ensemble [{}]", client, ensemble);
View Full Code Here

        Closeables.closeQuietly(curator);
    }

    private static CuratorFramework newCurator(ZooKeeperConfiguration config) {
        CuratorFramework curator = CuratorFrameworkFactory.newClient(config.getConnectString(), config.getRetry());
        curator.start();

        return curator.usingNamespace(config.getNamespace());
    }
}
View Full Code Here

        // Load the config.yaml file specified as the first argument.
        DictionaryConfiguration config = loadConfigFile(parsedArgs.getString("config-file"));

        CuratorFramework curator = config.getZooKeeperConfiguration().newCurator();
        curator.start();

        // Connection caching is optional, but included here for the sake of demonstration.
        ServiceCachingPolicy cachingPolicy = new ServiceCachingPolicyBuilder()
                .withMaxNumServiceInstances(10)
                .withMaxNumServiceInstancesPerEndPoint(1)
View Full Code Here

        DictionaryConfiguration config = ConfigurationFactory
                .forClass(DictionaryConfiguration.class, new Validator())
                .build(new File(args[0]));

        CuratorFramework curator = config.getZooKeeperConfiguration().newCurator();
        curator.start();

        // Connection caching is optional, but included here for the sake of demonstration.
        ServiceCachingPolicy cachingPolicy = new ServiceCachingPolicyBuilder()
                .withMaxNumServiceInstances(10)
                .withMaxNumServiceInstancesPerEndPoint(1)
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

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.