Package org.apache.jute

Examples of org.apache.jute.Record


                    break;
                case Leader.INFORM:
                    TxnHeader hdr = new TxnHeader();
                    ia = BinaryInputArchive
                            .getArchive(new ByteArrayInputStream(qp.getData()));
                    Record txn = SerializeUtils.deserializeTxn(ia, hdr);
                    zk.processTxn(hdr, txn);
                    break;
                case Leader.UPTODATE:
                    zk.takeSnapshot();
                    self.cnxnFactory.setZooKeeperServer(zk);               
View Full Code Here


                    zks.outstandingChangesForPath.remove(cr.path);
                }
            }
            if (request.hdr != null) {
               TxnHeader hdr = request.hdr;
               Record txn = request.txn;

               rc = zks.processTxn(hdr, txn);
            }
            // do not add non quorum packets to the queue.
            if (Request.isQuorum(request.type)) {
                zks.getZKDatabase().addCommittedProposal(request);
            }
        }

        if (request.hdr != null && request.hdr.getType() == OpCode.closeSession) {
            Factory scxn = zks.getServerCnxnFactory();
            // this might be possible since
            // we might just be playing diffs from the leader
            if (scxn != null && request.cnxn == null) {
                // calling this if we have the cnxn results in the client's
                // close session response being lost - we've already closed
                // the session/socket here before we can send the closeSession
                // in the switch block below
                scxn.closeSession(request.sessionId);
                return;
            }
        }

        if (request.cnxn == null) {
            return;
        }
        ServerCnxn cnxn = request.cnxn;

        String lastOp = "NA";
        zks.decInProcess();
        Code err = Code.OK;
        Record rsp = null;
        boolean closeSession = false;
        try {
            if (request.hdr != null && request.hdr.getType() == OpCode.error) {
                throw KeeperException.create(KeeperException.Code.get((
                        (ErrorTxn) request.txn).getErr()));
View Full Code Here

                        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())
                                    + " expected 0x"
                                    + Long.toHexString(lastQueued + 1));
View Full Code Here

    static public String packetToString(QuorumPacket p) {
        if (true)
            return null;
        String type = null;
        String mess = null;
        Record txn = null;
       
        switch (p.getType()) {
        case Leader.ACK:
            type = "ACK";
            break;
View Full Code Here

            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);
            request.txn = txn;
            request.hdr = hdr;
View Full Code Here

        String childStr = "";
        for (String s : child) {
            childStr += s + " ";
        }
 
        Record txn = null;
        TxnHeader txnHeader = null;
        if (type == OpCode.delete) {
            txn = new DeleteTxn(path);
            txnHeader = new TxnHeader(0xabcd, 0x123, prevPzxid + 1,
                System.currentTimeMillis(), OpCode.delete);
View Full Code Here

    public void testPad() throws Exception {
        File tmpDir = ClientBase.createTmpDir();
        FileTxnLog txnLog = new FileTxnLog(tmpDir);
        TxnHeader txnHeader = new TxnHeader(0xabcd, 0x123, 0x123,
              System.currentTimeMillis(), OpCode.create);
        Record txn = new CreateTxn("/Test", new byte[0], null, false);
        txnLog.append(txnHeader, txn);
        FileInputStream in = new FileInputStream(tmpDir.getPath() + "/log." +
              Long.toHexString(txnHeader.getZxid()));
        BinaryInputArchive ia  = BinaryInputArchive.getArchive(in);
        FileHeader header = new FileHeader();
View Full Code Here

            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())
                        + " expected 0x"
                        + Long.toHexString(lastQueued + 1));
View Full Code Here

                    break;
                case Leader.INFORM:
                    TxnHeader hdr = new TxnHeader();
                    ia = BinaryInputArchive
                            .getArchive(new ByteArrayInputStream(qp.getData()));
                    Record txn = SerializeUtils.deserializeTxn(ia, hdr);
                    zk.getZKDatabase().processTxn(hdr, txn);
                    break;
                case Leader.UPTODATE:
                    zk.takeSnapshot();
                    self.cnxnFactory.setZooKeeperServer(zk);               
View Full Code Here

        ServerCnxn cnxn = request.cnxn;

        String lastOp = "NA";
        zks.decInProcess();
        Code err = Code.OK;
        Record rsp = null;
        boolean closeSession = false;
        try {
            if (request.hdr != null && request.hdr.getType() == OpCode.error) {
                throw KeeperException.create(KeeperException.Code.get((
                        (ErrorTxn) request.txn).getErr()));
View Full Code Here

TOP

Related Classes of org.apache.jute.Record

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.