/// <summary> /// Constructs an version check operation. Arguments are as for the ZooKeeper.setData method except that /// no data is provided since no update is intended. The purpose for this is to allow read-modify-write /// operations that apply to multiple znodes, but where some of the znodes are involved only in the read, /// not the write. A similar effect could be achieved by writing the same data back, but that leads to /// way more version updates than are necessary and more writing in general. /// </summary> /// <param name="path"> /// the path of the node /// </param> /// <param name="version"> /// the expected matching version /// </param> public Transaction check(string path, int version) { ops.Add(Op.check(path, version)); return(this); }
/// <summary> /// Constructs an update operation. Arguments are as for the ZooKeeper method of the same name. /// </summary> /// <param name="path"> /// the path of the node /// </param> /// <param name="data"> /// the data to set /// </param> /// <param name="version"> /// the expected matching version /// </param> public Transaction setData(string path, byte[] data, int version = -1) { ops.Add(Op.setData(path, data, version)); return(this); }
/// <summary> /// Constructs a delete operation. Arguments are as for the ZooKeeper method of the same name. /// </summary> /// <param name="path"> /// the path of the node to be deleted. /// </param> /// <param name="version"> /// the expected node version. /// </param> public Transaction delete(string path, int version = -1) { ops.Add(Op.delete(path, version)); return(this); }