use of com.alibaba.otter.common.push.supplier.HaDatasourceInfo in project otter by alibaba.
the class MediaDatasourceSupplier method parse.
private HaDatasourceInfo parse(String matrixStr) {
HaDatasourceInfo haInfo = new HaDatasourceInfo();
Map jsonMap = JsonUtils.unmarshalFromString(matrixStr, HashMap.class);
String masterAddress = (String) jsonMap.get("master");
if (masterAddress != null) {
DatasourceInfo master = new DatasourceInfo();
master.setAddress(parseAddress(masterAddress));
haInfo.setMaster(master);
}
String slaveAddress = (String) jsonMap.get("master");
if (slaveAddress != null) {
DatasourceInfo slave = new DatasourceInfo();
slave.setAddress(parseAddress(slaveAddress));
haInfo.getSlavers().add(slave);
}
return haInfo;
}
Aggregations