String slave2 = "slave2";
String slave3 = "slave3";
String config1 = "config1";
TestZookeeper tz = new TestZookeeper();
ZooKeeper zk = new ZooKeeper(servers,3000,tz);
tz.zk = zk;
//每次启动时都先检查是否有根目录
createGroupNodesIfNotExist(zk,groupId);
updateOrCreateNode(zk,getGroupMasterZKPath(groupId)+"/"+master1,"master1value".getBytes("UTF-8"));
updateOrCreateNode(zk,getGroupMasterZKPath(groupId)+"/"+master2,"master2value".getBytes("UTF-8"));
updateOrCreateNode(zk,getGroupSlaveZKPath(groupId)+"/"+slave1,"slave1value".getBytes("UTF-8"));
updateOrCreateNode(zk,getGroupSlaveZKPath(groupId)+"/"+slave2,"slave2value".getBytes("UTF-8"));
updateOrCreateNode(zk,getGroupSlaveZKPath(groupId)+"/"+slave3,"slave3value".getBytes("UTF-8"));
updateOrCreateNode(zk,getGroupConfigZKPath(groupId)+"/"+config1,"config1value".getBytes("UTF-8"));
List<String> groups = zk.getChildren(AnalysisConstants.ZK_ROOT, false);
List<String> master = zk.getChildren(getGroupMasterZKPath(groups.get(0)), false);
List<String> slave = zk.getChildren(getGroupSlaveZKPath(groups.get(0)), false);
List<String> config = zk.getChildren(getGroupConfigZKPath(groups.get(0)), false);
System.out.println(new String(zk.getData(getGroupConfigZKPath(groups.get(0)) + "/" + config.get(0), false,null),"utf-8"));
Thread.sleep(200000);
}