Showing
1 changed file
with
2 additions
and
2 deletions
@@ -208,7 +208,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { | @@ -208,7 +208,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { | ||
208 | CuratorFramework client = CuratorFrameworkFactory.newClient(hostIp+ ":2181", 5 * 1000, 5 * 1000, retryPolicy); | 208 | CuratorFramework client = CuratorFrameworkFactory.newClient(hostIp+ ":2181", 5 * 1000, 5 * 1000, retryPolicy); |
209 | client.start(); | 209 | client.start(); |
210 | try { | 210 | try { |
211 | - byte[] data = req.getZkValue().getBytes(); | 211 | + byte[] data = req.getZkValue().getBytes("UTF-8"); |
212 | client.setData().forPath(req.getZkPath(), data); | 212 | client.setData().forPath(req.getZkPath(), data); |
213 | String newData = new String(client.getData().forPath(req.getZkPath())); | 213 | String newData = new String(client.getData().forPath(req.getZkPath())); |
214 | if(newData.equals(req.getZkValue())){ | 214 | if(newData.equals(req.getZkValue())){ |
@@ -249,7 +249,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { | @@ -249,7 +249,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { | ||
249 | String path=zkNode.getZkPath().replaceFirst(req.getOldRoot(), req.getRoot()); | 249 | String path=zkNode.getZkPath().replaceFirst(req.getOldRoot(), req.getRoot()); |
250 | if(null==client.checkExists().forPath(path)) | 250 | if(null==client.checkExists().forPath(path)) |
251 | { | 251 | { |
252 | - client.create().withMode(CreateMode.PERSISTENT).forPath(path,zkNode.getZkValue().getBytes()); | 252 | + client.create().withMode(CreateMode.PERSISTENT).forPath(path,zkNode.getZkValue().getBytes("UTF-8")); |
253 | } | 253 | } |
254 | 254 | ||
255 | } | 255 | } |
-
Please register or login to post a comment