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; }
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); }