Package org.apache.bookkeeper.client.QuorumEngine.Operation

Examples of org.apache.bookkeeper.client.QuorumEngine.Operation.AddOp


                        cleanQueue();
                        LOG.debug("Stopped");
                        break;
                    case Operation.ADD:
                        SubAddOp aOp = (SubAddOp) ts.ctx;
                        AddOp op = ((AddOp) aOp.op);
                       
                        long confirmed = self.getAddConfirmed();
                        ByteBuffer extendedData;
   
                        if(self.getQMode() == QMode.VERIFIABLE){
View Full Code Here


        LOG.debug("Adding entry " + data);
        RetCounter counter = new RetCounter();
        counter.inc();
       
        if(lh != null){
          Operation r = new AddOp(lh, data, this, counter);
          engines.get(lh.getId()).sendOp(r);
          //qeMap.get(lh.getId()).put(r);
       
          counter.block(0);
       
View Full Code Here

    public void asyncAddEntry(LedgerHandle lh, byte[] data, AddCallback cb, Object ctx)
    throws InterruptedException {
        LOG.debug("Adding entry asynchronously: " + data);
        //lh.incLast();
        if(lh != null){
            AddOp r = new AddOp(lh, data, cb, ctx);
            engines.get(lh.getId()).sendOp(r);
        }
        //qeMap.get(lh.getId()).put(r);
    }
View Full Code Here

                ToSend ts = incomingQueue.poll(1000, TimeUnit.MILLISECONDS);
                if(ts != null){
                    switch(ts.type){
                    case Operation.ADD:
                        SubAddOp aOp = (SubAddOp) ts.ctx;
                        AddOp op = ((AddOp) aOp.op);
                       
                        /*
                         * TODO: Really add the confirmed add to the op
                         */
                        long confirmed = self.getAddConfirmed();
View Full Code Here

                    }
                    LOG.debug("Request ready");

                    switch(op.type){
                    case Operation.ADD:
                        AddOp aOp = (AddOp) op;
                   
                        aOp.cb.addComplete(aOp.getErrorCode(),
                            aOp.getLedger().getId(), aOp.entry,
                            aOp.ctx);
                        aOp.getLedger().setAddConfirmed(aOp.entry);
                        break;
                    case Operation.READ:
                        ReadOp rOp = (ReadOp) op;
                        LOG.debug("Got one message from the queue: " + rOp.firstEntry);
                        rOp.cb.readComplete(rOp.getErrorCode(),
View Full Code Here

                        }
                    }
                   
                    switch(op.type){
                    case Operation.ADD:
                        AddOp aOp = (AddOp) op;
                      
                        aOp.getLedger().setAddConfirmed(aOp.entry);
                        aOp.cb.addComplete(aOp.getErrorCode(),
                                aOp.getLedger(),
                                aOp.entry,
                                aOp.ctx);
                       
                        break;
                    case Operation.READ:
View Full Code Here

     * @param cb    object implementing callbackinterface
     * @param ctx   some control object
     */
    public void asyncAddEntry(byte[] data, AddCallback cb, Object ctx)
    throws InterruptedException, BKException {
        AddOp r = new AddOp(this, data, cb, ctx);
        qe.sendOp(r);
    }
View Full Code Here

    throws InterruptedException, BKException{
        LOG.debug("Adding entry " + data);
        RetCounter counter = new RetCounter();
        counter.inc();
       
        Operation r = new AddOp(this, data, this, counter);
        qe.sendOp(r);  
        //qeMap.get(lh.getId()).put(r);
        counter.block(0);
        return counter.getrc();
    }
View Full Code Here

                        cleanQueue();
                        LOG.debug("Stopped");
                        break;
                    case Operation.ADD:
                        SubAddOp aOp = (SubAddOp) ts.ctx;
                        AddOp op = ((AddOp) aOp.op);
                       
                        long confirmed = self.getAddConfirmed();
                        ByteBuffer extendedData;
   
                        if(self.getQMode() == QMode.VERIFIABLE){
View Full Code Here

TOP

Related Classes of org.apache.bookkeeper.client.QuorumEngine.Operation.AddOp

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.