Search in sources :

Example 1 with Zookeeper

use of com.alibaba.jstorm.zk.Zookeeper in project jstorm by alibaba.

the class ZooKeeperDataViewTest method init.

@BeforeClass
public static void init() {
    String CONFIG_PATH = System.getProperty("user.home") + CONFIG_FILE;
    File file = new File(CONFIG_PATH);
    if (file.exists() == false) {
        SKIP = true;
        return;
    }
    try {
        zkobj = new Zookeeper();
        System.getProperties().setProperty("storm.conf.file", CONFIG_PATH);
        Map conf = Utils.readStormConfig();
        zk = zkobj.mkClient(conf, (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS), conf.get(Config.STORM_ZOOKEEPER_PORT), (String) conf.get(Config.STORM_ZOOKEEPER_ROOT));
        gson = new GsonBuilder().setPrettyPrinting().create();
    } catch (Throwable e) {
        e.printStackTrace();
        SKIP = true;
    }
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) Zookeeper(com.alibaba.jstorm.zk.Zookeeper) ArrayList(java.util.ArrayList) List(java.util.List) File(java.io.File) Map(java.util.Map) BeforeClass(org.junit.BeforeClass)

Aggregations

Zookeeper (com.alibaba.jstorm.zk.Zookeeper)1 GsonBuilder (com.google.gson.GsonBuilder)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 BeforeClass (org.junit.BeforeClass)1