Examples of FixedEnsembleProvider


Examples of org.apache.curator.ensemble.fixed.FixedEnsembleProvider

            public ZooKeeper newZooKeeper(String connectString, int sessionTimeout, Watcher watcher, boolean canBeReadOnly) throws Exception
            {
                return mockZookeeper;
            }
        };
        CuratorZookeeperClient  client = new CuratorZookeeperClient(zookeeperFactory, new FixedEnsembleProvider(server.getConnectString()), 10000, 10000, null, new RetryOneTime(1), false);
        client.start();
        Assert.assertEquals(client.getZooKeeper(), mockZookeeper);
    }
View Full Code Here

Examples of org.apache.curator.ensemble.fixed.FixedEnsembleProvider

     * @param watcher default watcher or null
     * @param retryPolicy the retry policy to use
     */
    public CuratorZookeeperClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, Watcher watcher, RetryPolicy retryPolicy)
    {
        this(new DefaultZookeeperFactory(), new FixedEnsembleProvider(connectString), sessionTimeoutMs, connectionTimeoutMs, watcher, retryPolicy, false);
    }
View Full Code Here

Examples of org.apache.curator.ensemble.fixed.FixedEnsembleProvider

    }

    public static CuratorFramework createCuratorFramework(CuratorConfig curatorConfig, ACLProvider aclProviderInstance, List<ConnectionStateListener> connectionListenerList) {
        CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
                .canBeReadOnly(true)
                .ensembleProvider(new FixedEnsembleProvider(curatorConfig.getZookeeperUrl()))
                .connectionTimeoutMs(curatorConfig.getZookeeperConnectionTimeOut())
                .sessionTimeoutMs(curatorConfig.getZookeeperSessionTimeout())
                .retryPolicy(new RetryNTimes(curatorConfig.getZookeeperRetryMax(), curatorConfig.getZookeeperRetryInterval()));

        if (!Strings.isNullOrEmpty(curatorConfig.getZookeeperPassword())) {
View Full Code Here

Examples of org.apache.curator.ensemble.fixed.FixedEnsembleProvider

    protected CuratorFramework createCurator() throws KeeperException {
        log.info(String.format("Creating curator [%s], mode: %s", connection, getCreateMode()));

        CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
            .ensembleProvider(new FixedEnsembleProvider(connection))
            .connectionTimeoutMs(connectionTimeout)
            .sessionTimeoutMs(sessionTimeout)
            .retryPolicy(new RetryNTimes(maxRetry, retryInterval));

        if (password != null && password.length() > 0) {
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.