public boolean equals(Object peer_) { if (!(peer_ instanceof SetDataResponse)) { return false; } if (peer_ == this) { return true; } SetDataResponse peer = (SetDataResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof SetACLResponse)) { return false; } if (peer_ == this) { return true; } SetACLResponse peer = (SetACLResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof ExistsResponse)) { return false; } if (peer_ == this) { return true; } ExistsResponse peer = (ExistsResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof SetDataResponse)) { return false; } if (peer_ == this) { return true; } SetDataResponse peer = (SetDataResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof ExistsResponse)) { return false; } if (peer_ == this) { return true; } ExistsResponse peer = (ExistsResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof SetACLResponse)) { return false; } if (peer_ == this) { return true; } SetACLResponse peer = (SetACLResponse) peer_; boolean ret = false; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof GetACLResponse)) { return false; } if (peer_ == this) { return true; } GetACLResponse peer = (GetACLResponse) peer_; boolean ret = false; ret = acl.equals(peer.acl); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof Create2Response)) { return false; } if (peer_ == this) { return true; } Create2Response peer = (Create2Response) peer_; boolean ret = false; ret = path.equals(peer.path); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof GetChildren2Response)) { return false; } if (peer_ == this) { return true; } GetChildren2Response peer = (GetChildren2Response) peer_; boolean ret = false; ret = children.equals(peer.children); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public byte[] get(String key, Stat stat) { Entry entry = cache.get(key); if (entry == null) { return null; } if (!stat.equals(entry.stat)) { // The node has been modified, invalidate cache. cache.remove(key); return null; } else { return entry.data; } }
public boolean equals(Object peer_) { if (!(peer_ instanceof GetACLResponse)) { return false; } if (peer_ == this) { return true; } GetACLResponse peer = (GetACLResponse) peer_; boolean ret = false; ret = acl.equals(peer.acl); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof GetChildren2Response)) { return false; } if (peer_ == this) { return true; } GetChildren2Response peer = (GetChildren2Response) peer_; boolean ret = false; ret = children.equals(peer.children); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof GetDataResponse)) { return false; } if (peer_ == this) { return true; } GetDataResponse peer = (GetDataResponse) peer_; boolean ret = false; ret = org.apache.jute.Utils.bufEquals(data,peer.data); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
public boolean equals(Object peer_) { if (!(peer_ instanceof GetDataResponse)) { return false; } if (peer_ == this) { return true; } GetDataResponse peer = (GetDataResponse) peer_; boolean ret = false; ret = org.apache.jute.Utils.bufEquals(data,peer.data); if (!ret) return ret; ret = stat.equals(peer.stat); if (!ret) return ret; return ret; } public int hashCode() {
private void deleteZKDir(ZooKeeper zk, String nodeName) throws IOException, InterruptedException, KeeperException { Stat stat = zk.exists(nodeName, false); if (stat == null) { return; } List<String> children1 = zk.getChildren(nodeName, false); List<String> c2 = zk.getChildren(nodeName, false, stat); if (!children1.equals(c2)) { Assert.fail("children lists from getChildren()/getChildren2() do not match"); } if (!stat.equals(stat)) { Assert.fail("stats from exists()/getChildren2() do not match"); } if (children1.size() == 0) { zk.delete(nodeName, -1); return; } for (String n : children1) { deleteZKDir(zk, n); } }
@Test public void testCreateWithStat() throws IOException, KeeperException, InterruptedException { String name = "/foo"; Stat stat = createWithStatVerifyResult("/foo"); Stat childStat = createWithStatVerifyResult("/foo/child"); // Don't expect to get the same stats for different creates. Assert.assertFalse(stat.equals(childStat)); }
@Test(timeout = 30000) public void testCreateWithStat() throws KeeperException, InterruptedException { Stat stat = createWithStatVerifyResult("/foo"); Stat childStat = createWithStatVerifyResult("/foo/child"); // Don't expect to get the same stats for different creates. Assert.assertFalse(stat.equals(childStat)); }
if (!stat_parent.equals(stat)) { Assert.fail("stat from exists()/getChildren() do not match");
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof NodeChildren)) { return false; } NodeChildren that = (NodeChildren) o; return stat.equals(that.getStat()) && children.equals(that.getChildren()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof NodeData)) { return false; } BasicNodeData that = (BasicNodeData) o; return stat.equals(that.getStat()) && Arrays.equals(data, that.getData()); }