use of com.alibaba.cobar.config.util.ConfigException in project cobar by alibaba.
the class ConfigInitializer method initDataNodes.
private Map<String, MySQLDataNode> initDataNodes(ConfigLoader configLoader) {
Map<String, DataNodeConfig> nodeConfs = configLoader.getDataNodes();
Map<String, MySQLDataNode> nodes = new HashMap<String, MySQLDataNode>(nodeConfs.size());
for (DataNodeConfig conf : nodeConfs.values()) {
MySQLDataNode dataNode = getDataNode(conf, configLoader);
if (nodes.containsKey(dataNode.getName())) {
throw new ConfigException("dataNode " + dataNode.getName() + " duplicated!");
}
nodes.put(dataNode.getName(), dataNode);
}
return nodes;
}
Aggregations