Examples of BinaryInputArchive


Examples of org.apache.jute.BinaryInputArchive

        }

        void readResponse() throws IOException {
            ByteBufferInputStream bbis = new ByteBufferInputStream(
                    incomingBuffer);
            BinaryInputArchive bbia = BinaryInputArchive.getArchive(bbis);
            ReplyHeader replyHdr = new ReplyHeader();

            replyHdr.deserialize(bbia, "header");
            if (replyHdr.getXid() == -2) {
                // -2 is the xid for pings
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

                readPacket(qp);
                switch(qp.getType()) {
                case Leader.PROPOSAL:
                    PacketInFlight pif = new PacketInFlight();
                    pif.hdr = new TxnHeader();
                    BinaryInputArchive ia = BinaryInputArchive
                            .getArchive(new ByteArrayInputStream(qp.getData()));
                    pif.rec     = SerializeUtils.deserializeTxn(ia, pif.hdr);
                    if (pif.hdr.    getZxid() != lastQueued + 1) {
                    LOG.warn("Got zxid 0x"
                            + Long.toHexString(pif.hdr.getZxid())
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

import org.apache.zookeeper.KeeperException;

public class DeserializationPerfTest extends TestCase {
    private static void deserializeTree(int depth, int width, int len)
            throws InterruptedException, IOException, KeeperException.NodeExistsException, KeeperException.NoNodeException {
        BinaryInputArchive ia;
        int count;
        {
            DataTree tree = new DataTree();
            SerializationPerfTest.createNodes(tree, "/", depth, width, new byte[len]);
            count = tree.getNodeCount();
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

                        qp.setData(bos.toByteArray());
                        writePacket(qp, true);
                        break;
                    case Leader.PROPOSAL:
                        TxnHeader hdr = new TxnHeader();
                        BinaryInputArchive ia = BinaryInputArchive
                                .getArchive(new ByteArrayInputStream(qp.getData()));
                        Record txn = SerializeUtils.deserializeTxn(ia, hdr);
                        if (hdr.getZxid() != lastQueued + 1) {
                            LOG.warn("Got zxid 0x"
                                    + Long.toHexString(hdr.getZxid())
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

    }

    private void readRequest() throws IOException {
        // We have the request, now process and setup for next
        InputStream bais = new ByteBufferInputStream(incomingBuffer);
        BinaryInputArchive bia = BinaryInputArchive.getArchive(bais);
        RequestHeader h = new RequestHeader();
        h.deserialize(bia, "header");
        // Through the magic of byte buffers, txn will not be
        // pointing
        // to the start of the txn
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

            }
        }
    }

    private void readConnectRequest() throws IOException, InterruptedException {
        BinaryInputArchive bia = BinaryInputArchive
                .getArchive(new ByteBufferInputStream(incomingBuffer));
        ConnectRequest connReq = new ConnectRequest();
        connReq.deserialize(bia, "connect");
        LOG.info("Connected to " + sock.socket().getRemoteSocketAddress()
                + " lastZxid " + connReq.getLastZxidSeen());
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

        case Leader.PING:
            type = "PING";
            break;
        case Leader.PROPOSAL:
            type = "PROPOSAL";
            BinaryInputArchive ia = BinaryInputArchive
                    .getArchive(new ByteArrayInputStream(p.getData()));
            TxnHeader hdr = new TxnHeader();
            try {
                txn = SerializeUtils.deserializeTxn(ia, hdr);
                // mess = "transaction: " + txn.toString();
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

        }
    }

    static public void byteBuffer2Record(ByteBuffer bb, Record record)
            throws IOException {
        BinaryInputArchive ia;
        ia = BinaryInputArchive.getArchive(new ByteBufferInputStream(bb));
        record.deserialize(ia, "request");
    }
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

        case Leader.SYNC:
            ((ObserverZooKeeperServer)zk).sync();
            break;
        case Leader.INFORM:           
            TxnHeader hdr = new TxnHeader();
            BinaryInputArchive ia = BinaryInputArchive
                    .getArchive(new ByteArrayInputStream(qp.getData()));
            Record txn = SerializeUtils.deserializeTxn(ia, hdr);
            Request request = new Request (null, hdr.getClientId(),
                                           hdr.getCxid(),
                                           hdr.getType(), null, null);
View Full Code Here

Examples of org.apache.jute.BinaryInputArchive

        }

        void readConnectResult() throws IOException {
            ByteBufferInputStream bbis = new ByteBufferInputStream(
                    incomingBuffer);
            BinaryInputArchive bbia = BinaryInputArchive.getArchive(bbis);
            ConnectResponse conRsp = new ConnectResponse();
            conRsp.deserialize(bbia, "connect");
            negotiatedSessionTimeout = conRsp.getTimeOut();
            if (negotiatedSessionTimeout <= 0) {
                zooKeeper.state = States.CLOSED;
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.