Package org.apache.accumulo.core.client

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


    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

TOP

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

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.