use of com.actiontech.dble.config.loader.zkprocess.comm.ZookeeperProcessListen in project dble by actiontech.
the class XmltoZkMain method writeConfFileToZK.
public static void writeConfFileToZK(boolean isAll, final int allMode) throws Exception {
ZookeeperProcessListen zkListen = new ZookeeperProcessListen();
CuratorFramework zkConn = ZKUtils.getConnection();
XmlProcessBase xmlProcess = new XmlProcessBase();
// xmltozk for schema
new SchemasxmlTozkLoader(zkListen, zkConn, xmlProcess);
// xmltozk for server
new ServerxmlTozkLoader(zkListen, zkConn, xmlProcess);
// xmltozk for rule
new RulesxmlTozkLoader(zkListen, zkConn, xmlProcess);
xmlProcess.initJaxbClass();
zkListen.initAllNode();
zkListen.clearInited();
// write flag
ConfStatus status = new ConfStatus(ZkConfig.getInstance().getValue(ClusterParamCfg.CLUSTER_CFG_MYID), isAll ? ConfStatus.Status.RELOAD_ALL : ConfStatus.Status.RELOAD, isAll ? String.valueOf(allMode) : null);
zkConn.setData().forPath(KVPathUtil.getConfStatusPath(), status.toString().getBytes(StandardCharsets.UTF_8));
}
use of com.actiontech.dble.config.loader.zkprocess.comm.ZookeeperProcessListen in project dble by actiontech.
the class ZktoXmlMain method loadZktoFile.
/**
* @throws Exception
* @Created 2016/9/21
*/
public static void loadZktoFile() throws Exception {
// get zk conn
CuratorFramework zkConn = ZKUtils.getConnection();
// if first start,init zk
initZKIfNot(zkConn);
// load zk listen
ZookeeperProcessListen zkListen = new ZookeeperProcessListen();
initLocalConfFromZK(zkListen, zkConn);
// load watch
loadZkWatch(zkListen.getWatchPath(), zkConn, zkListen);
}
use of com.actiontech.dble.config.loader.zkprocess.comm.ZookeeperProcessListen in project dble by actiontech.
the class XmltoZkMain method initFileToZK.
public static void initFileToZK() throws Exception {
ZookeeperProcessListen zkListen = new ZookeeperProcessListen();
CuratorFramework zkConn = ZKUtils.getConnection();
XmlProcessBase xmlProcess = new XmlProcessBase();
new SchemasxmlTozkLoader(zkListen, zkConn, xmlProcess);
new ServerxmlTozkLoader(zkListen, zkConn, xmlProcess);
new RulesxmlTozkLoader(zkListen, zkConn, xmlProcess);
new SequenceTozkLoader(zkListen, zkConn);
new EcachesxmlTozkLoader(zkListen, zkConn, xmlProcess);
new OthermsgTozkLoader(zkListen, zkConn);
xmlProcess.initJaxbClass();
zkListen.initAllNode();
zkListen.clearInited();
String confInited = KVPathUtil.getConfInitedPath();
if (zkConn.checkExists().forPath(confInited) == null) {
zkConn.create().creatingParentContainersIfNeeded().forPath(confInited);
}
}
Aggregations