...
|
...
|
@@ -85,7 +85,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
String rootString = "";
|
|
|
int page=0;
|
|
|
RetryPolicy retryPolicy = new RetryOneTime(1000);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.102.205"+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getZkIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
client.start();
|
|
|
try {
|
|
|
List<String> children = client.getChildren().forPath(root);
|
...
|
...
|
@@ -121,7 +121,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
List<ZkConfigAll> list = new ArrayList<ZkConfigAll>();
|
|
|
int page=0;
|
|
|
RetryPolicy retryPolicy = new RetryOneTime(1000);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.102.205"+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
client.start();
|
|
|
try {
|
|
|
list=getAllChildren(req.getZkPath(),client,req.getIp());
|
...
|
...
|
@@ -150,7 +150,6 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
|
|
|
|
|
|
public List<ZkConfigAll> getAllChildren(String parentPath,CuratorFramework client,String ip) {
|
|
|
int n=0;
|
|
|
List<ZkConfigAll> childList=new ArrayList<ZkConfigAll>();
|
|
|
try {
|
|
|
//取该路径下的所有子节点
|
...
|
...
|
@@ -166,7 +165,6 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
zkNode.setZkValue(data);
|
|
|
List<String> liString = client.getChildren().forPath(nodePath);
|
|
|
if(CollectionUtils.isEmpty(liString)){
|
|
|
n++;
|
|
|
childList.add(zkNode);
|
|
|
}else {
|
|
|
//递归
|
...
|
...
|
@@ -184,7 +182,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
public int editZkMonitorDetail(ZkTreeAllReq req) {
|
|
|
int result = 0;
|
|
|
RetryPolicy retryPolicy = new RetryOneTime(1000);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.102.205"+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
client.start();
|
|
|
try {
|
|
|
byte[] data = req.getZkValue().getBytes();
|
...
|
...
|
@@ -208,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("192.168.102.205"+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
CuratorFramework client = CuratorFrameworkFactory.newClient(req.getZkIp()+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
|
|
|
client.start();
|
|
|
try {
|
|
|
List<ZkConfigAll> childList=getAllChildren(req,client);
|
...
|
...
|
|