Package org.apache.zookeeper.txn

Examples of org.apache.zookeeper.txn.TxnHeader.serialize()


      oa.writeString("BenWasHere", "signature");
      TxnHeader hdr = new TxnHeader(0, 0, 0, 0, ZooDefs.OpCode.create);
      CreateTxn txn = new CreateTxn("/foo", new byte[0], new ArrayList<ACL>(), false, sl.zk.getZKDatabase().getNode("/").stat.getCversion());
          ByteArrayOutputStream tbaos = new ByteArrayOutputStream();
          BinaryOutputArchive boa = BinaryOutputArchive.getArchive(tbaos);
          hdr.serialize(boa, "hdr");
          txn.serialize(boa, "txn");
          tbaos.close();
      qp = new QuorumPacket(Leader.PROPOSAL, 1, tbaos.toByteArray(), null);
      oa.writeRecord(qp, null);
View Full Code Here


      oa.writeString("BenWasHere", "signature");
      TxnHeader hdr = new TxnHeader(0, 0, 0, 0, ZooDefs.OpCode.create);
      CreateTxn txn = new CreateTxn("/foo", new byte[0], new ArrayList<ACL>(), false, sl.zk.getZKDatabase().getNode("/").stat.getCversion());
          ByteArrayOutputStream tbaos = new ByteArrayOutputStream();
          BinaryOutputArchive boa = BinaryOutputArchive.getArchive(tbaos);
          hdr.serialize(boa, "hdr");
          txn.serialize(boa, "txn");
          tbaos.close();
      qp = new QuorumPacket(Leader.PROPOSAL, 1, tbaos.toByteArray(), null);
      oa.writeRecord(qp, null);
View Full Code Here

        BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
        Proposal p = new Proposal();
        try {
            TxnHeader hdr = itr.getHeader();
            Record txn = itr.getTxn();
            hdr.serialize(boa, "hdr");
            if (txn != null) {
                txn.serialize(boa, "txn");
            }
            baos.close();
View Full Code Here

            oa.writeString("BenWasHere", "signature");
            TxnHeader hdr = new TxnHeader(0, 0, 0, 0, ZooDefs.OpCode.create);
            CreateTxn txn = new CreateTxn("/foo", new byte[0], new ArrayList<ACL>(), false, sl.zk.getZKDatabase().getNode("/").stat.getCversion());
            ByteArrayOutputStream tbaos = new ByteArrayOutputStream();
            BinaryOutputArchive boa = BinaryOutputArchive.getArchive(tbaos);
            hdr.serialize(boa, "hdr");
            txn.serialize(boa, "txn");
            tbaos.close();
            qp = new QuorumPacket(Leader.PROPOSAL, 1, tbaos.toByteArray(), null);
            oa.writeRecord(qp, null);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.