Exemple #1
0
 public static boolean writeNodeInfo(
     ZooKeeper zk, String name, String backend, DistributedCacheSchema.NodeInfo info)
     throws KeeperException, InterruptedException, InvalidProtocolBufferException {
   byte[] data = info.toByteArray();
   zk.setData("/" + name + "/" + backend + "/info", data, -1);
   return true;
 }
Exemple #2
0
 public static DistributedCacheSchema.NodeInfo readNodeInfo(
     ZooKeeper zk, String name, String backend)
     throws KeeperException, InterruptedException, InvalidProtocolBufferException {
   byte[] data = zk.getData("/" + name + "/" + backend + "/info", false, null);
   return DistributedCacheSchema.NodeInfo.parseFrom(data);
 }