Search in sources :

Example 1 with ZKQuorum

use of com.linkedin.d2.quorum.ZKQuorum in project rest.li by linkedin.

the class TestD2ConfigWithZKQuorum method setup.

private void setup() throws Exception {
    // Start _quorum
    _quorum = new ZKQuorum(QUORUM_SIZE);
    _quorum.startAll();
    _quorum.assertAllPeersUp();
}
Also used : ZKQuorum(com.linkedin.d2.quorum.ZKQuorum)

Example 2 with ZKQuorum

use of com.linkedin.d2.quorum.ZKQuorum in project rest.li by linkedin.

the class TestD2ZKQuorumFailover method setup.

private void setup() throws IOException, Exception {
    // Start _quorum
    _quorum = new ZKQuorum(QUORUM_SIZE);
    _quorum.startAll();
    _quorum.assertAllPeersUp();
    _zkUriString = "zk://" + _quorum.getHosts();
    _zkHosts = _quorum.getHosts().split(",");
    // Register clusters/services with zookeeper _quorum
    LoadBalancerClientCli.runDiscovery(_quorum.getHosts(), "/d2", D2_CONFIG_DATA);
    // Echo servers startup
    startAllEchoServers();
    assertAllEchoServersRunning(_echoServers);
    // Get LoadBalancer Client
    _cli = new LoadBalancerClientCli(_quorum.getHosts(), "/d2");
    _client = _cli.createZKFSTogglingLBClient(_quorum.getHosts(), "/d2", null);
    assertAllEchoServersRegistered(_cli.getZKClient(), _zkUriString, _echoServers);
    assertQuorumProcessAllRequests(D2_CONFIG_DATA);
}
Also used : LoadBalancerClientCli(com.linkedin.d2.balancer.util.LoadBalancerClientCli) ZKQuorum(com.linkedin.d2.quorum.ZKQuorum)

Example 3 with ZKQuorum

use of com.linkedin.d2.quorum.ZKQuorum in project rest.li by linkedin.

the class TestPartitionsWithZKQuorum method setup.

private void setup() throws IOException, Exception {
    // Start _quorum
    _quorum = new ZKQuorum(QUORUM_SIZE);
    _quorum.startAll();
    _zkUriString = "zk://" + _quorum.getHosts();
    _zkHosts = _quorum.getHosts().split(",");
    _quorum.assertAllPeersUp();
}
Also used : ZKQuorum(com.linkedin.d2.quorum.ZKQuorum)

Aggregations

ZKQuorum (com.linkedin.d2.quorum.ZKQuorum)3 LoadBalancerClientCli (com.linkedin.d2.balancer.util.LoadBalancerClientCli)1