Search in sources :

Example 6 with ZkConnection

use of org.I0Itec.zkclient.ZkConnection in project samza by apache.

the class TestZkUtils method testSetup.

@Before
public void testSetup() {
    try {
        zkClient = new ZkClient(new ZkConnection("127.0.0.1:" + zkServer.getPort(), SESSION_TIMEOUT_MS), CONNECTION_TIMEOUT_MS);
    } catch (Exception e) {
        Assert.fail("Client connection setup failed. Aborting tests..");
    }
    try {
        zkClient.createPersistent(KEY_BUILDER.getProcessorsPath(), true);
    } catch (ZkNodeExistsException e) {
    // Do nothing
    }
    zkUtils = new ZkUtils(KEY_BUILDER, zkClient, SESSION_TIMEOUT_MS);
    zkUtils.connect();
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) ZkNodeExistsException(org.I0Itec.zkclient.exception.ZkNodeExistsException) ZkConnection(org.I0Itec.zkclient.ZkConnection) SamzaException(org.apache.samza.SamzaException) ZkNodeExistsException(org.I0Itec.zkclient.exception.ZkNodeExistsException) Before(org.junit.Before)

Aggregations

ZkClient (org.I0Itec.zkclient.ZkClient)6 ZkConnection (org.I0Itec.zkclient.ZkConnection)6 ZkUtils (kafka.utils.ZkUtils)5 Properties (java.util.Properties)1 ZkNodeExistsException (org.I0Itec.zkclient.exception.ZkNodeExistsException)1 TestingServer (org.apache.curator.test.TestingServer)1 SamzaException (org.apache.samza.SamzaException)1 Before (org.junit.Before)1 Tuple2 (scala.Tuple2)1 Iterator (scala.collection.Iterator)1