Examples of RetryNTimes


Examples of com.netflix.curator.retry.RetryNTimes

    }

    public void init() throws Exception {

        this.client = CuratorFrameworkFactory.builder().namespace(namespace).connectString(connectString)
                .retryPolicy(new RetryNTimes(this.zkRetries, this.zkRetryInterval)).build();
        this.client.start();
        super.initWatcher();
    }
View Full Code Here

Examples of com.netflix.curator.retry.RetryNTimes

        String connectString = zkHosts(conf);
        int retryCount = Utils.getInt(conf.get("storm.zookeeper.retry.times"));
        int retryInterval = Utils.getInt(conf.get("storm.zookeeper.retry.interval"));

        this.client = CuratorFrameworkFactory.builder().namespace(namespace).connectString(connectString)
                .retryPolicy(new RetryNTimes(retryCount, retryInterval)).build();
        this.client.start();

        super.initWatcher();
    }
View Full Code Here

Examples of com.netflix.curator.retry.RetryNTimes

  public CuratorZookeeperClient(URL url) {
    super(url);
    try {
      Builder builder = CuratorFrameworkFactory.builder()
          .connectString(url.getBackupAddress())
              .retryPolicy(new RetryNTimes(Integer.MAX_VALUE, 1000)) 
              .connectionTimeoutMs(5000);
      String authority = url.getAuthority();
      if (authority != null && authority.length() > 0) {
        builder = builder.authorization("digest", authority.getBytes());
      }
View Full Code Here

Examples of com.netflix.curator.retry.RetryNTimes

        startZooKeeper();
    }

    @SuppressWarnings("UnusedDeclaration")
    public CuratorFramework newCurator() throws Exception {
        return newCurator(CuratorFrameworkFactory.builder().retryPolicy(new RetryNTimes(0, 0)));
    }
View Full Code Here

Examples of com.netflix.curator.retry.RetryNTimes

  public CuratorZookeeperClient(URL url) {
    super(url);
    try {
      Builder builder = CuratorFrameworkFactory.builder()
          .connectString(url.getBackupAddress())
              .retryPolicy(new RetryNTimes(Integer.MAX_VALUE, 1000)) 
              .connectionTimeoutMs(5000);
      String authority = url.getAuthority();
      if (authority != null && authority.length() > 0) {
        builder = builder.authorization("digest", authority.getBytes());
      }
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    {
        final int SLEEP = 1000;
        final int TIMES = 5;

        Timing timing = new Timing();
        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryNTimes(TIMES, SLEEP));
        try
        {
            client.start();
            client.getZookeeperClient().blockUntilConnectedOrTimedOut();
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

    {

        CuratorFramework client = CuratorFrameworkFactory.builder()
            .connectString(server.getConnectString())
            .sessionTimeoutMs(60000)
            .retryPolicy(new RetryNTimes(1, 1000)).build();
        final CountDownLatch latch = new CountDownLatch(1);
        try
        {
            client.start();
            BackgroundCallback curatorCallback = new BackgroundCallback()
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

            serverPorts = serverPorts + server + ":" + port + ",";
        }
        return CuratorFrameworkFactory.newClient(serverPorts,
                Utils.getInt(stateConf.get(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT)),
                15000,
                new RetryNTimes(Utils.getInt(stateConf.get(Config.STORM_ZOOKEEPER_RETRY_TIMES)),
                        Utils.getInt(stateConf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL))));
    }
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

        try {
            _curator = CuratorFrameworkFactory.newClient(
                    zkStr,
                    Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT)),
                    Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_CONNECTION_TIMEOUT)),
                    new RetryNTimes(Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_TIMES)),
                            Utils.getInt(conf.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL))));
            _curator.start();
        } catch (Exception ex) {
            LOG.error("Couldn't connect to zookeeper", ex);
        }
View Full Code Here

Examples of org.apache.curator.retry.RetryNTimes

            client = CuratorFrameworkFactory.builder()
                .connectString(cluster.getConnectString())
                .sessionTimeoutMs(timing.session())
                .connectionTimeoutMs(timing.connection())
                .retryPolicy(new RetryNTimes(3, timing.milliseconds()))
                .canBeReadOnly(true)
                .build();

            final BlockingQueue<ConnectionState> states = Queues.newLinkedBlockingQueue();
            client.getConnectionStateListenable().addListener
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.