Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.ConditionalWriter$Result


    String table = getUniqueNames(1)[0];
    Connector conn = getConnector();

    conn.tableOperations().create(table);

    ConditionalWriter cw = conn.createConditionalWriter(table, new ConditionalWriterConfig());

    conn.tableOperations().offline(table, true);

    ConditionalMutation cm1 = new ConditionalMutation("r1", new Condition("tx", "seq"));
    cm1.put("tx", "seq", "1");
    cm1.put("data", "x", "a");

    Result result = cw.write(cm1);

    try {
      result.getStatus();
      Assert.assertFalse(true);
    } catch (AccumuloException ae) {
      Assert.assertEquals(TableOfflineException.class, ae.getCause().getClass());
    }

    cw.close();

    try {
      conn.createConditionalWriter(table, new ConditionalWriterConfig());
      Assert.assertFalse(true);
    } catch (TableOfflineException e) {}
View Full Code Here


    String table = getUniqueNames(1)[0];
    Connector conn = getConnector();

    conn.tableOperations().create(table);

    ConditionalWriter cw = conn.createConditionalWriter(table, new ConditionalWriterConfig());

    IteratorSetting iterSetting = new IteratorSetting(5, BadIterator.class);

    ConditionalMutation cm1 = new ConditionalMutation("r1", new Condition("tx", "seq").setIterators(iterSetting));
    cm1.put("tx", "seq", "1");
    cm1.put("data", "x", "a");

    Result result = cw.write(cm1);

    try {
      result.getStatus();
      Assert.assertFalse(true);
    } catch (AccumuloException ae) {

    }

    cw.close();
  }
View Full Code Here

    String table = getUniqueNames(1)[0];
    Connector conn = getConnector();

    conn.tableOperations().create(table);

    ConditionalWriter cw = conn.createConditionalWriter(table, new ConditionalWriterConfig());

    ConditionalMutation cm1 = new ConditionalMutation("r1");
    cm1.put("tx", "seq", "1");
    cm1.put("data", "x", "a");

    cw.write(cm1);
  }
View Full Code Here

      setFaultCode(fCode);
    }
   
    setFaultString(getMessage());
   
    Result r = this.objectFactory.createResult();
    ErrInfo ei = this.objectFactory.createErrInfo();

    if (errCode != null) {
      ei.setErrCode(errCode);
    }

    ei.setValue(getMessage());

     r.setErrno(errno);

    if (ei != null) {
      r.setErrInfo(ei);
    }

    addResult(r);
  }
View Full Code Here

  {
    if (this.dispReport==null) {
      this.dispReport = this.objectFactory.createDispositionReport();
    }

    Result jaxbResult = this.objectFactory.createResult();
    this.dispReport.getResult().add(jaxbResult);
   
    if (result.getErrInfo() != null) jaxbResult.setErrInfo(result.getErrInfo());
    if (result.getKeyType() != null) jaxbResult.setKeyType(result.getKeyType());
    jaxbResult.setErrno(result.getErrno());
  }
View Full Code Here

            keyResultArr = new Result[resultList.size()];
            resultList.toArray(keyResultArr);
           
            log.debug("After deleting Business. Obtained vector size:" + keyResultArr != null ? keyResultArr.length : 0);
            for (int i = 0; keyResultArr != null && i < keyResultArr.length; i++) {
                Result result = (Result) keyResultArr[i];
                int errno = result.getErrno();
                if (errno == 0) {
                    coll.addAll(keys);
                }
                else {
                    ErrInfo errinfo = result.getErrInfo();
                    DeleteException de = new DeleteException(errinfo.getErrCode() + ":" + errinfo.getValue());
                    bulk.setStatus(JAXRResponse.STATUS_FAILURE);
                    exceptions.add(de);
                }
            }
View Full Code Here

        private DispositionReport getSuccessMessage() {
                DispositionReport r = new DispositionReport();
                r.setGeneric("2.0");
                r.setTruncated(Truncated.FALSE);
                Result x = new Result();
                r.setOperator(getNodeID());
                r.getResult().add(x);
                return r;
        }
View Full Code Here

   
   
    new ValidateSubscriptionListener().validateNotification(body);
     
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
    return dr;
  }
View Full Code Here

    return ResourceConfig.getGlobalMessage(errCode);
  }   

  public static final DispositionReport buildDispositionReport(int errNo) {
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    res.setErrno(errNo);
   
    ErrInfo ei = new ErrInfo();
    ei.setErrCode(lookupErrCode(errNo));
    ei.setValue(lookupErrText(errNo));
   
    res.setErrInfo(ei);
   
    dr.getResult().add(res);
       
    return dr;
  }
View Full Code Here

   
   
    new ValidateSubscriptionListener().validateNotification(body);
     
    DispositionReport dr = new DispositionReport();
    Result res = new Result();
    dr.getResult().add(res);
    return dr;
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.ConditionalWriter$Result

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.