Examples of AddOp


Examples of com.alimama.mdrill.editlog.AddOp

  public final FSEditLogOpCodes opCode;
  public long txid;
  final public static class OpInstanceCache {
    private HashMap<FSEditLogOpCodes, FSEditLogOp> inst =  new HashMap<FSEditLogOpCodes, FSEditLogOp>();
    public OpInstanceCache() {
      inst.put(FSEditLogOpCodes.OP_ADD, new AddOp());
    }
View Full Code Here

Examples of com.alimama.mdrill.editlog.AddOp

   
    this.status.lastAddDocumentTime.set(System.currentTimeMillis());
    if(writelog)
    {
      try {
        AddOp op=new AddOp();
        op.setDoc(doc);
        synchronized (editlog) {
          if(!needRollLogs.get())
          {
            editlog.openForWrite();
            needRollLogs.set(true);
View Full Code Here

Examples of com.alimama.mdrill.editlog.AddOp

      {
        for(EditLogInputStream stream:streams)
        {
          while(true)
          {
            AddOp op=null;
            try {
              op = (AddOp) stream.readOp();
              if (op == null) {
                  LOG.error("readOp end");

                break;
              }
              if(op.getDoc()==null)
              {
                  LOG.error("readOp doc null");

                continue;
              }
            } catch (Throwable e) {
              LOG.error("readOp", e);
              break;
            }
           
            SolrInputDocument doc=op.getDoc();
            doc.setTxid(op.getTransactionId());
            if(lines<100000)
            {
              lines++;
              if(lines%500==0)
              {
View Full Code Here

Examples of com.alimama.mdrill.editlog.AddOp

   
    this.status.lastAddDocumentTime.set(System.currentTimeMillis());
    if(writelog)
    {
      try {
        AddOp op=new AddOp();
        op.setDoc(doc);
        synchronized (editlog) {
          if(!needRollLogs.get())
          {
            editlog.openForWrite();
            needRollLogs.set(true);
View Full Code Here

Examples of com.alimama.mdrill.editlog.AddOp

      {
        for(EditLogInputStream stream:streams)
        {
          while(true)
          {
            AddOp op=null;
            try {
              op = (AddOp) stream.readOp();
              if (op == null) {
                  LOG.error("readOp end");

                break;
              }
              if(op.getDoc()==null)
              {
                  LOG.error("readOp doc null");

                continue;
              }
            } catch (Throwable e) {
              LOG.error("readOp", e);
              break;
            }
           
            SolrInputDocument doc=op.getDoc();
            doc.setTxid(op.getTransactionId());
            if(lines<100000)
            {
              lines++;
              if(lines%500==0)
              {
View Full Code Here

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

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

        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

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

    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

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

                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

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

                    }
                    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
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.