Package org.apache.bookkeeper.client.QuorumEngine

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


        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


            throw BKException.create(Code.ReadException);
       
        RetCounter counter = new RetCounter();
        counter.inc();
       
        Operation r = new ReadOp(lh, firstEntry, lastEntry, this, counter);
        engines.get(lh.getId()).sendOp(r);
        //qeMap.get(lh.getId()).put(r);
        LOG.debug("Going to wait for read entries: " + counter.i);
        counter.block(0);
        LOG.debug("Done with waiting: " + counter.i + ", " + firstEntry);
View Full Code Here

    throws BKException, InterruptedException {
        // Little sanity check
        if((firstEntry > lh.getLast()) || (firstEntry > lastEntry))
            throw BKException.create(Code.ReadException);
       
        Operation r = new ReadOp(lh, firstEntry, lastEntry, cb, ctx);
        engines.get(lh.getId()).sendOp(r);
        //qeMap.get(lh.getId()).put(r);
    }
View Full Code Here

   
    public void run(){
        try{
            while(!stop){
                LOG.debug("Going to sleep on queue");
                Operation op = pendingOps.poll(1000, TimeUnit.MILLISECONDS);
                if(op != null){
                    synchronized(op){
                        while(!op.isReady()){
                            op.wait();
                        }
                    }
                    LOG.debug("Request ready");

                    switch(op.type){
View Full Code Here

     */
   
    public void run(){
        try{
            while(!stop){
                Operation op = pendingOps.poll(1000, TimeUnit.MILLISECONDS);
                if(op != null){
                    synchronized(op){
                        while(!op.isReady()){
                            op.wait(1000);
                        }
                    }
                   
                    switch(op.type){
                    case Operation.ADD:
View Full Code Here

    throws BKException, InterruptedException {
        // Little sanity check
        if((firstEntry > getLast()) || (firstEntry > lastEntry))
            throw BKException.create(Code.ReadException);
       
        Operation r = new ReadOp(this, firstEntry, lastEntry, cb, ctx);
        qe.sendOp(r);
        //qeMap.get(lh.getId()).put(r);
    }
View Full Code Here

            throw BKException.create(Code.ReadException);
       
        RetCounter counter = new RetCounter();
        counter.inc();
    
        Operation r = new ReadOp(this, firstEntry, lastEntry, this, counter);
        qe.sendOp(r);
       
        LOG.debug("Going to wait for read entries: " + counter.i);
        counter.block(0);
        LOG.debug("Done with waiting: " + counter.i + ", " + firstEntry);
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

TOP

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

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.