Exemplo n.º 1
0
Arquivo: Tools.java Projeto: 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;
 }
Exemplo n.º 2
0
Arquivo: Tools.java Projeto: 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);
 }