Authored by fanzelei

update

... ... @@ -85,7 +85,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
String rootString = "";
int page=0;
RetryPolicy retryPolicy = new RetryOneTime(1000);
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getZkIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
client.start();
try {
List<String> children = client.getChildren().forPath(root);
... ... @@ -95,7 +95,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
rootString = root+"/"+chi;
zkConfig.setName(chi);
zkConfig.setRoot(rootString);
zkConfig.setZkIp(req.getZkIp());
zkConfig.setIp(req.getIp());
list.add(zkConfig);
page++;
}
... ... @@ -106,7 +106,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
response.setRows(list);
} catch (Exception e) {
logger.error("getZkMonitorTree fail with ip is {}",req.getZkIp());
logger.error("getZkMonitorTree fail with ip is {}",req.getIp());
e.printStackTrace();
} finally {
client.close();
... ... @@ -206,7 +206,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
public int editZkMonitorRoot(ZkTreeReq req) {
int result = 0;
RetryPolicy retryPolicy = new RetryOneTime(1000);
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getZkIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
client.start();
try {
List<ZkConfigAll> childList=getAllChildren(req,client);
... ...
... ... @@ -7,7 +7,7 @@ import com.monitor.model.page.PageRequest;
@Data
public class ZkTreeReq extends PageRequest{
private String zkIp;
private String ip;
private String name;
... ...
... ... @@ -8,7 +8,7 @@ import lombok.Data;
@Data
public class ZkConfig extends PageRequest implements Serializable{
private String zkIp;
private String ip;
private String name;
... ...