Package org.apache.zookeeper.txn

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


      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);

      // setup the messages to be streamed to follower
View Full Code Here


      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);

      // setup the messages to be streamed to follower
View Full Code Here

            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);

            // setup the messages to be streamed to follower
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.