Esempio n. 1
0
File: Tools.java Progetto: goby/oce
 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;
 }
Esempio n. 2
0
File: Tools.java Progetto: goby/oce
 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);
 }