use of com.actiontech.dble.config.loader.zkprocess.parse.XmlProcessBase in project dble by actiontech.
the class ZktoXmlMain method initLocalConfFromZK.
private static void initLocalConfFromZK(ZookeeperProcessListen zkListen, CuratorFramework zkConn) throws Exception {
ConfigStatusListener confListener = new ConfigStatusListener(zkListen, zkConn);
XmlProcessBase xmlProcess = new XmlProcessBase();
// load schema
new SchemaszkToxmlLoader(zkListen, zkConn, xmlProcess, confListener);
// load server
new ServerzkToxmlLoader(zkListen, zkConn, xmlProcess, confListener);
// load rule
new RuleszkToxmlLoader(zkListen, zkConn, xmlProcess, confListener);
// load sequence
new SequenceTopropertiesLoader(zkListen, zkConn);
// load ehcache
new EcacheszkToxmlLoader(zkListen, zkConn, xmlProcess);
ZKUtils.addChildPathCache(KVPathUtil.getOnlinePath(), new OfflineStatusListener());
// transform bindata data to local file
ZKUtils.addChildPathCache(KVPathUtil.getBinDataPath(), new BinDataPathChildrenCacheListener());
new BinlogPauseStatusListener(zkListen, zkConn);
// init xml
xmlProcess.initJaxbClass();
// notify all
zkListen.initAllNode();
zkListen.clearInited();
}
use of com.actiontech.dble.config.loader.zkprocess.parse.XmlProcessBase 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.parse.XmlProcessBase in project dble by actiontech.
the class XmltoUcore method initFileToUcore.
public static void initFileToUcore() throws Exception {
UcoreClearKeyListener ucoreListen = new UcoreClearKeyListener();
XmlProcessBase xmlProcess = new XmlProcessBase();
new UXmlRuleLoader(xmlProcess, ucoreListen);
new UXmlServerLoader(xmlProcess, ucoreListen);
new UXmlSchemaLoader(xmlProcess, ucoreListen);
new UXmlEhcachesLoader(xmlProcess, ucoreListen);
new UPropertySequenceLoader(ucoreListen);
xmlProcess.initJaxbClass();
ucoreListen.initAllNode();
}
use of com.actiontech.dble.config.loader.zkprocess.parse.XmlProcessBase in project dble by actiontech.
the class UcoreToXml method loadKVtoFile.
public static void loadKVtoFile() {
try {
// create a new listener to the ucore config change
listener = new UcoreClearKeyListener();
XmlProcessBase xmlProcess = new XmlProcessBase();
listener.init();
// add all loader into listener map list
new UXmlRuleLoader(xmlProcess, listener);
new UXmlSchemaLoader(xmlProcess, listener);
new UXmlServerLoader(xmlProcess, listener);
new UXmlEhcachesLoader(xmlProcess, listener);
new UPropertySequenceLoader(listener);
xmlProcess.initJaxbClass();
// add listener to watch the Prefix of the keys
new UConfigStatusResponse(listener);
new UBinlogPauseStatusResponse(listener);
ddlListener = new UcoreSingleKeyListener(UcorePathUtil.getDDLPath() + SEPARATOR, new UDdlChildResponse());
viewListener = new UcoreSingleKeyListener(UcorePathUtil.getViewChangePath() + SEPARATOR, new UViewChildResponse());
onlineListener = new UOffLineListener();
listener.initForXml();
Thread thread = new Thread(listener);
thread.start();
ddlListener.init();
Thread thread2 = new Thread(ddlListener);
thread2.start();
viewListener.init();
Thread thread3 = new Thread(viewListener);
thread3.start();
onlineListener.init();
Thread thread4 = new Thread(onlineListener);
thread4.start();
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.actiontech.dble.config.loader.zkprocess.parse.XmlProcessBase 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