public ZKStateStorage(Map<String, Object> conf, Map<String, Object> authConf, ClusterStateContext context) throws Exception {
this.conf = conf;
this.authConf = authConf;
if (context.getDaemonType().equals(DaemonType.NIMBUS)) {
this.isNimbus = true;
}
CuratorFramework zkTemp = mkZk(context.getDaemonType());
String rootPath = String.valueOf(conf.get(Config.STORM_ZOOKEEPER_ROOT));
ClientZookeeper.mkdirs(zkTemp, rootPath, context.getDefaultZkAcls());
zkTemp.close();
active = new AtomicBoolean(true);
zkWriter = mkZk(new ZkWatcherCallBack(), context.getDaemonType());
if (isNimbus) {
zkReader = mkZk(new ZkWatcherCallBack(), context.getDaemonType());
} else {
zkReader = zkWriter;
}
}