use of com.actiontech.dble.config.loader.zkprocess.zookeeper.DataInf in project dble by actiontech.
the class EcacheszkToxmlLoader method zktoEhcacheWrite.
/**
* zktoEhcacheWrite
*
* @param zkDirectory
* @return
* @Created 2016/9/17
*/
private void zktoEhcacheWrite(ZkDirectoryImpl zkDirectory) {
DataInf ehcacheZkDirectory = this.getZkData(zkDirectory, KVPathUtil.EHCACHE_NAME);
Ehcache ehcache = parseJsonEhcacheService.parseJsonToBean(ehcacheZkDirectory.getDataValue());
String outputPath = ResourceUtil.getResourcePathFromRoot(ZookeeperPath.ZK_LOCAL_WRITE_PATH.getKey());
outputPath = new File(outputPath).getPath() + File.separator;
outputPath += KVPathUtil.EHCACHE_NAME;
parseEcacheXMl.parseToXmlWrite(ehcache, outputPath, null);
this.zookeeperListen.addWatch(KVPathUtil.getEhcacheNamePath(), this);
DataInf cacheserZkDirectory = this.getZkData(zkDirectory, KVPathUtil.CACHESERVER_NAME);
if (null != cacheserZkDirectory) {
ZkDataImpl cacheData = (ZkDataImpl) cacheserZkDirectory;
try {
ConfFileRWUtils.writeFile(cacheData.getName(), cacheData.getValue());
} catch (IOException e) {
LOGGER.warn(AlarmCode.CORE_ZK_WARN + "EcacheszkToxmlLoader wirteMapFile IOException", e);
}
this.zookeeperListen.addWatch(KVPathUtil.getCacheServerNamePath(), this);
}
}
use of com.actiontech.dble.config.loader.zkprocess.zookeeper.DataInf in project dble by actiontech.
the class RuleszkToxmlLoader method zktoRulesBean.
/**
* zktoRulesBean
*
* @param zkDirectory
* @return
* @Created 2016/9/17
*/
private Rules zktoRulesBean(DirectoryInf zkDirectory) {
Rules rules = new Rules();
// tablerule
DataInf rulesZkData = this.getZkData(zkDirectory, KVPathUtil.TABLE_RULE);
List<TableRule> tableRuleData = parseJsonTableRuleService.parseJsonToBean(rulesZkData.getDataValue());
rules.setTableRule(tableRuleData);
// function
DataInf functionZkData = this.getZkData(zkDirectory, KVPathUtil.FUNCTION);
List<Function> functionList = parseJsonFunctionService.parseJsonToBean(functionZkData.getDataValue());
rules.setFunction(functionList);
return rules;
}
use of com.actiontech.dble.config.loader.zkprocess.zookeeper.DataInf in project dble by actiontech.
the class SchemaszkToxmlLoader method zktoSchemasBean.
private Schemas zktoSchemasBean(ZkDirectoryImpl zkDirectory) {
Schemas schema = new Schemas();
DataInf schemaZkDirectory = this.getZkData(zkDirectory, KVPathUtil.SCHEMA_SCHEMA);
List<Schema> schemaList = parseJsonSchema.parseJsonToBean(schemaZkDirectory.getDataValue());
schema.setSchema(schemaList);
DataInf dataNodeZkDirectory = this.getZkData(zkDirectory, KVPathUtil.DATA_NODE);
List<DataNode> dataNodeList = parseJsonDataNode.parseJsonToBean(dataNodeZkDirectory.getDataValue());
schema.setDataNode(dataNodeList);
DataInf dataHostZkDirectory = this.getZkData(zkDirectory, KVPathUtil.DATA_HOST);
List<DataHost> dataHostList = parseJsonDataHost.parseJsonToBean(dataHostZkDirectory.getDataValue());
schema.setDataHost(dataHostList);
return schema;
}
use of com.actiontech.dble.config.loader.zkprocess.zookeeper.DataInf in project dble by actiontech.
the class ServerzkToxmlLoader method zktoServerBean.
/**
* zktoServerBean
*
* @param zkDirectory
* @return
* @Created 2016/9/17
* @create
*/
private Server zktoServerBean(DirectoryInf zkDirectory) {
Server server = new Server();
DataInf serverZkDirectory = this.getZkData(zkDirectory, KVPathUtil.DEFAULT);
System systemValue = parseJsonSystem.parseJsonToBean(serverZkDirectory.getDataValue());
server.setSystem(systemValue);
DataInf firewallZkDirectory = this.getZkData(zkDirectory, KVPathUtil.FIREWALL);
FireWall fireWall = parseJsonFireWall.parseJsonToBean(firewallZkDirectory.getDataValue());
server.setFirewall(fireWall);
DataInf userZkDirectory = this.getZkData(zkDirectory, KVPathUtil.USER);
List<User> userList = parseJsonUser.parseJsonToBean(userZkDirectory.getDataValue());
server.setUser(userList);
return server;
}
Aggregations