/** * 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. * * @param path * the path of the node * @param version * the expected matching version */ public static Op check(String path, int version) { return new Check(path, version); }
@Override public Record toRequestRecord() { return new CheckVersionRequest(getPath(), version); }
@Override Op withChroot(String path) { return new Check(path, version); } }
/** * 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. * * @param path * the path of the node * @param version * the expected matching version */ public static Op check(String path, int version) { return new Check(path, version); }
@Override public Record toRequestRecord() { return new CheckVersionRequest(getPath(), version); }
@Override Op withChroot(String path) { return new Check(path, version); } }