Search in sources :

Example 1 with ZooKeeperStringSerializer

use of org.apache.flink.streaming.connectors.kafka.testutils.ZooKeeperStringSerializer in project flink by apache.

the class KafkaTestEnvironmentImpl method getZkUtils.

public ZkUtils getZkUtils() {
    LOG.info("In getZKUtils:: zookeeperConnectionString = {}", zookeeperConnectionString);
    ZkClient creator = new ZkClient(zookeeperConnectionString, Integer.valueOf(standardProps.getProperty("zookeeper.session.timeout.ms")), Integer.valueOf(standardProps.getProperty("zookeeper.connection.timeout.ms")), new ZooKeeperStringSerializer());
    return ZkUtils.apply(creator, false);
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) ZooKeeperStringSerializer(org.apache.flink.streaming.connectors.kafka.testutils.ZooKeeperStringSerializer)

Example 2 with ZooKeeperStringSerializer

use of org.apache.flink.streaming.connectors.kafka.testutils.ZooKeeperStringSerializer in project flink by apache.

the class KafkaTestEnvironmentImpl method deleteTestTopic.

@Override
public void deleteTestTopic(String topic) {
    ZkUtils zkUtils = getZkUtils();
    try {
        LOG.info("Deleting topic {}", topic);
        ZkClient zk = new ZkClient(zookeeperConnectionString, Integer.valueOf(standardProps.getProperty("zookeeper.session.timeout.ms")), Integer.valueOf(standardProps.getProperty("zookeeper.connection.timeout.ms")), new ZooKeeperStringSerializer());
        AdminUtils.deleteTopic(zkUtils, topic);
        zk.close();
    } finally {
        zkUtils.close();
    }
}
Also used : ZkClient(org.I0Itec.zkclient.ZkClient) ZooKeeperStringSerializer(org.apache.flink.streaming.connectors.kafka.testutils.ZooKeeperStringSerializer) ZkUtils(kafka.utils.ZkUtils)

Aggregations

ZkClient (org.I0Itec.zkclient.ZkClient)2 ZooKeeperStringSerializer (org.apache.flink.streaming.connectors.kafka.testutils.ZooKeeperStringSerializer)2 ZkUtils (kafka.utils.ZkUtils)1