Examples of ZooKeeperConnectionManager


Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

  public ZooKeeperConnectionManager build()
  {
    _announcer.setWeight(1d);

    return new ZooKeeperConnectionManager(_zkHostname + ":" + _zkPort,
                                          _sessionTimeoutInMs,
                                          _basePath,
                                          new ZKUriStoreFactory(),
                                          _announcer);
  }
View Full Code Here

Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

    // write D2-related configuration to ZooKeeper
    // all the configuration here are permanent, no need to re-write as long as ZooKeeper still has the data
    // therefore in real case, do this "discovery" step separately

    final HttpServer server = RestLiExampleBasicServer.createServer();
    final ZooKeeperConnectionManager zkConn = createZkConn();

    startServer(server, zkConn);

    System.out.println("Example server with D2 is running with URL " + RestLiExampleBasicServer.getServerUrl() + ". Press any key to stop server.");
    System.in.read();
View Full Code Here

Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

    //create d2 announcers (for announcing the existence of these servers to the world)
    ZooKeeperAnnouncer[] zkAnnouncers = createZkAnnouncers(d2ServersConfigs);

    //manager will keep track of the lifecycle of d2 announcers i.e. start publishing
    //once connected to zookeeper, reconnect if zookeeper is disconnected, etc
    ZooKeeperConnectionManager manager = createZkManager(json, zkAnnouncers);

    System.out.println("Starting zookeeper announcers");
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    startAnnouncers(manager, executorService, timeout);
View Full Code Here

Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

    ZKUriStoreFactory factory = new ZKUriStoreFactory();
    String zkConnectString = (String)json.get("zkConnectString");
    int zkRetryLimit = ((Long)json.get("zkRetryLimit")).intValue();
    int zkSessionTimeout = ((Long)json.get("zkSessionTimeout")).intValue();
    String zkBasePath = (String)json.get("zkBasePath");
    return new ZooKeeperConnectionManager(zkConnectString,
                                          zkSessionTimeout,
                                          zkBasePath,
                                          factory,
                                          zkRetryLimit,
                                          zkAnnouncers);
View Full Code Here

Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

    //create d2 announcers (for announcing the existence of these servers to the world)
    ZooKeeperAnnouncer[] zkAnnouncers = createZkAnnouncers(d2ServersConfigs);

    //manager will keep track of the lifecycle of d2 announcers i.e. start publishing
    //once connected to zookeeper, reconnect if zookeeper is disconnected, etc
    ZooKeeperConnectionManager manager = createZkManager(json, zkAnnouncers);

    System.out.println("Starting zookeeper announcers");
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    startAnnouncers(manager, executorService, timeout);
View Full Code Here

Examples of com.linkedin.d2.balancer.servers.ZooKeeperConnectionManager

    ZKUriStoreFactory factory = new ZKUriStoreFactory();
    String zkConnectString = (String)json.get("zkConnectString");
    int zkRetryLimit = ((Long)json.get("zkRetryLimit")).intValue();
    int zkSessionTimeout = ((Long)json.get("zkSessionTimeout")).intValue();
    String zkBasePath = (String)json.get("zkBasePath");
    return new ZooKeeperConnectionManager(zkConnectString,
                                          zkSessionTimeout,
                                          zkBasePath,
                                          factory,
                                          zkRetryLimit,
                                          zkAnnouncers);
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.