Authored by qinchao

新功能

... ... @@ -208,7 +208,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
CuratorFramework client = CuratorFrameworkFactory.newClient(hostIp+ ":2181", 5 * 1000, 5 * 1000, retryPolicy);
client.start();
try {
byte[] data = req.getZkValue().getBytes();
byte[] data = req.getZkValue().getBytes("UTF-8");
client.setData().forPath(req.getZkPath(), data);
String newData = new String(client.getData().forPath(req.getZkPath()));
if(newData.equals(req.getZkValue())){
... ... @@ -249,7 +249,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService {
String path=zkNode.getZkPath().replaceFirst(req.getOldRoot(), req.getRoot());
if(null==client.checkExists().forPath(path))
{
client.create().withMode(CreateMode.PERSISTENT).forPath(path,zkNode.getZkValue().getBytes());
client.create().withMode(CreateMode.PERSISTENT).forPath(path,zkNode.getZkValue().getBytes("UTF-8"));
}
}
... ...