Package org.apache.zookeeper_voltpatches.data

Examples of org.apache.zookeeper_voltpatches.data.StatPersisted


            throws KeeperException.NoNodeException,
            KeeperException.NodeExistsException {
        int lastSlash = path.lastIndexOf('/');
        String parentName = path.substring(0, lastSlash);
        String childName = path.substring(lastSlash + 1);
        StatPersisted stat = new StatPersisted();
        stat.setCtime(time);
        stat.setMtime(time);
        stat.setCzxid(zxid);
        stat.setMzxid(zxid);
        stat.setPzxid(zxid);
        stat.setVersion(0);
        stat.setAversion(0);
        stat.setEphemeralOwner(ephemeralOwner);
        DataNode parent = nodes.get(parentName);
        if (parent == null) {
            throw new KeeperException.NoNodeException();
        }
        synchronized (parent) {
View Full Code Here


                    throw new KeeperException.NoChildrenForEphemeralsException(
                            path);
                }
                txn = new CreateTxn(path, createRequest.getData(),
                        createRequest.getAcl(), createMode.isEphemeral());
                StatPersisted s = new StatPersisted();
                if (createMode.isEphemeral()) {
                    s.setEphemeralOwner(request.sessionId);
                }
                parentRecord = parentRecord.duplicate(txnHeader.getZxid());
                parentRecord.childCount++;
                parentRecord.stat
                        .setCversion(parentRecord.stat.getCversion() + 1);
View Full Code Here

        List<ACL> acl; /* Make sure to create a new object when changing */

        @SuppressWarnings("unchecked")
        ChangeRecord duplicate(long zxid) {
            StatPersisted stat = new StatPersisted();
            if (this.stat != null) {
                DataTree.copyStatPersisted(this.stat, stat);
            }
            return new ChangeRecord(zxid, path, stat, childCount,
                    acl == null ? new ArrayList<ACL>() : new ArrayList(acl));
View Full Code Here

    synchronized public void deserialize(InputArchive archive, String tag)
            throws IOException {
        archive.startRecord("node");
        data = archive.readBuffer("data");
        acl = archive.readLong("acl");
        stat = new StatPersisted();
        stat.deserialize(archive, "statpersisted");
        archive.endRecord("node");
    }
View Full Code Here

  }
  public int compareTo (Object peer_) throws ClassCastException {
    if (!(peer_ instanceof StatPersisted)) {
      throw new ClassCastException("Comparing different types of records.");
    }
    StatPersisted peer = (StatPersisted) peer_;
    int ret = 0;
    ret = (czxid == peer.czxid)? 0 :((czxid<peer.czxid)?-1:1);
    if (ret != 0) return ret;
    ret = (mzxid == peer.mzxid)? 0 :((mzxid<peer.mzxid)?-1:1);
    if (ret != 0) return ret;
View Full Code Here

      return false;
    }
    if (peer_ == this) {
      return true;
    }
    StatPersisted peer = (StatPersisted) peer_;
    boolean ret = false;
    ret = (czxid==peer.czxid);
    if (!ret) return ret;
    ret = (mzxid==peer.mzxid);
    if (!ret) return ret;
View Full Code Here

TOP

Related Classes of org.apache.zookeeper_voltpatches.data.StatPersisted

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.