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