Example #1
0
File: Tools.java Project: goby/oce
 public static boolean writeNodeStatus(
     ZooKeeper zk, String name, String backend, DistributedCacheSchema.NodeStatus status)
     throws KeeperException, InterruptedException, InvalidProtocolBufferException {
   byte[] data = status.toByteArray();
   zk.setData("/" + name + "/" + backend + "/status", data, -1);
   return true;
 }
Example #2
0
File: Tools.java Project: goby/oce
 public static DistributedCacheSchema.NodeStatus readNodeStatus(
     ZooKeeper zk, String name, String backend)
     throws KeeperException, InterruptedException, InvalidProtocolBufferException {
   byte[] data = zk.getData("/" + name + "/" + backend + "/status", false, null);
   return DistributedCacheSchema.NodeStatus.parseFrom(data);
 }