Package org.apache.zookeeper.server

Examples of org.apache.zookeeper.server.Request


    }

    LinkedBlockingQueue<Request> pendingTxns = new LinkedBlockingQueue<Request>();

    public void logRequest(TxnHeader hdr, Record txn) {
        Request request = new Request(null, hdr.getClientId(), hdr.getCxid(),
                hdr.getType(), null, null);
        request.hdr = hdr;
        request.txn = txn;
        request.zxid = hdr.getZxid();
        if ((request.zxid & 0xffffffffL) != 0) {
View Full Code Here


            LOG.fatal("Committing zxid 0x" + Long.toHexString(zxid)
                    + " but next pending txn 0x"
                    + Long.toHexString(firstElementZxid));
            System.exit(12);
        }
        Request request = pendingTxns.remove();
        commitProcessor.commit(request);
    }
View Full Code Here

        if(pendingSyncs.size() ==0){
            LOG.warn("Not expecting a sync.");
            return;
        }
               
        Request r = pendingSyncs.remove();
    commitProcessor.commit(r);
    }
View Full Code Here

                    bb = bb.slice();
                    if(type == OpCode.sync){
                       leader.zk.submitRequest(new FollowerSyncRequest(this, sessionId, cxid, type, bb,
                                qp.getAuthinfo()));
                    } else {
                        Request si = new Request(null, sessionId, cxid, type, bb, qp.getAuthinfo());
                        si.setOwner(this);
                        leader.zk.submitRequest(si);
                    }
                    break;
                default:
                }
View Full Code Here

                    bb = bb.slice();
                    if(type == OpCode.sync){
                       leader.zk.submitRequest(new FollowerSyncRequest(this, sessionId, cxid, type, bb,
                                qp.getAuthinfo()));
                    } else {
                        Request si = new Request(null, sessionId, cxid, type, bb, qp.getAuthinfo());
                        si.setOwner(this);
                        leader.zk.submitRequest(si);
                    }
                    break;
                default:
                }
View Full Code Here

        f.startup(zks);
        Assert.assertTrue("waiting for server being up ",
                ClientBase.waitForServerUp(HOSTPORT,CONNECTION_TIMEOUT));
        zks.sessionTracker = new MySessionTracker();
        PrepRequestProcessor processor = new PrepRequestProcessor(zks, new MyRequestProcessor());
        Request foo = new Request(null, 1l, 1, OpCode.create, ByteBuffer.allocate(3), null);
        processor.pRequest(foo);
    }
View Full Code Here

    }

    public void run() {
        try {
            while (!finished) {
                Request request = queuedRequests.take();

                // log request
                long traceMask = ZooTrace.CLIENT_REQUEST_TRACE_MASK;
                if (request.type == OpCode.ping) {
                    traceMask = ZooTrace.CLIENT_PING_TRACE_MASK;
View Full Code Here

        if(pendingSyncs.size() ==0){
            LOG.warn("Not expecting a sync.");
            return;
        }
               
        Request r = pendingSyncs.remove();
        commitProcessor.commit(r);
    }
View Full Code Here

                    bb = ByteBuffer.wrap(qp.getData());
                    sessionId = bb.getLong();
                    cxid = bb.getInt();
                    type = bb.getInt();
                    bb = bb.slice();
                    Request si;
                    if(type == OpCode.sync){
                        si = new LearnerSyncRequest(this, sessionId, cxid, type, bb, qp.getAuthinfo());
                    } else {
                        si = new Request(null, sessionId, cxid, type, bb, qp.getAuthinfo());
                    }
                    si.setOwner(this);
                    leader.zk.submitRequest(si);
                    break;
                default:
                }
            }
View Full Code Here

                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                OutputArchive boa = BinaryOutputArchive.getArchive(baos);
                boa.writeRecord(hdr, "header");
                boa.writeRecord(ct, "txn");
                baos.close();
                Request rq = new Request(null, 1, 1, ZooDefs.OpCode.create, ByteBuffer.wrap(baos.toByteArray()), null);
                rq.zxid = zxid;
                rq.hdr = hdr;
                rq.txn = ct;
                return rq;
            }
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.server.Request

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.