Package org.apache.curator.framework.CuratorFrameworkFactory

Examples of org.apache.curator.framework.CuratorFrameworkFactory.Builder


  public ZooKeeperTestingServerManager(final String namespace) {
    this.dataDir = Files.createTempDir();

    final ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);

    Builder builder = CuratorFrameworkFactory.builder()
        .connectString(endpoint)
        .retryPolicy(retryPolicy);

    if (namespace != null) {
      builder = builder.namespace(namespace);
    }

    curator = builder.build();
    curator.start();
    start();
  }
View Full Code Here


    public CuratorFramework newClient(String connectString,
                                      int sessionTimeoutMs,
                                      int connectionTimeoutMs,
                                      RetryPolicy retryPolicy,
                                      String namespace) {
      Builder builder = CuratorFrameworkFactory.builder()
          .connectString(connectString)
          .sessionTimeoutMs(sessionTimeoutMs)
          .connectionTimeoutMs(connectionTimeoutMs)
          .retryPolicy(retryPolicy);

      if (namespace != null) {
        log.info("Setting ZooKeeper namespace to " + namespace);
        builder = builder.namespace(namespace);
      }

      return builder.build();
    }
View Full Code Here

TOP

Related Classes of org.apache.curator.framework.CuratorFrameworkFactory.Builder

Copyright © 2018 www.massapicom. 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.