Examples of addMutation()


Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    for (Entry<Key,Value> entry : mscanner) {
      Key k = entry.getKey();
      Mutation m = new Mutation(k.getRow());
      m.putDelete(k.getColumnFamily(), k.getColumnQualifier());
      Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
      bw.addMutation(m);
    }

    bw.close();

  }
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

      log.debug("Looking at entry " + entry + " with tid " + tid);
      if (Long.parseLong(entry.getValue().toString()) == tid) {
        log.debug("deleting entry " + entry);
        Mutation m = new Mutation(entry.getKey().getRow());
        m.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier());
        bw.addMutation(m);
      }
    }
    bw.close();
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

      Mutation m = new Mutation("a");
      for (int i = 0; i < 50; i++) {
        m.put("colf", Integer.toString(i), "");
      }
     
      bw.addMutation(m);
    } finally {
      if (null != bw) {
        bw.close();
      }
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

  protected void writeVersionable(Connector c, String tableName, int size) throws TableNotFoundException, MutationsRejectedException {
    for (int i = 0; i < size; i++) {
      BatchWriter w = c.createBatchWriter(tableName, new BatchWriterConfig());
      Mutation m = new Mutation("row1");
      m.put("cf", "cq", String.valueOf(i));
      w.addMutation(m);
      w.close();
    }
  }
 
  protected void assertVersionable(Connector c, String tableName, int size) throws TableNotFoundException {
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    c.tableOperations().create(TEST_TABLE_1);
    BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
    for (int i = 0; i < 100; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
      m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
      bw.addMutation(m);
    }
    bw.close();
   
    MRTester.main(new String[] {"root", "", TEST_TABLE_1});
    assertNull(e1);
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    for (int r = 0; r < 20; r++) {
      Mutation m = new Mutation("" + r);
      for (int c = 0; c < 5; c++) {
        m.put(new Text("cf"), new Text("" + c), new Value(("" + c).getBytes()));
      }
      bw.addMutation(m);
    }
    bw.flush();
    to.deleteRows("test", new Text("1"), new Text("2"));
    Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
    int oneCnt = 0;
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    for (int r = 0; r < 30; r++) {
      Mutation m = new Mutation(Integer.toString(r));
      for (int c = 0; c < 5; c++) {
        m.put(new Text("cf"), new Text(Integer.toString(c)), new Value(Integer.toString(c).getBytes()));
      }
      bw.addMutation(m);
    }
    bw.flush();

    // test null end
    // will remove rows 4 through 9 (6 * 5 = 30 entries)
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

   
    // test multi row deletes
    writer = c.createBatchWriter("test", new BatchWriterConfig());
    m = new Mutation("r1");
    m.put("fam", "qual", "value");
    writer.addMutation(m);
    Mutation m2 = new Mutation("r2");
    m2.put("fam", "qual", "value");
    writer.addMutation(m2);
   
    // make sure the write goes through
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    m = new Mutation("r1");
    m.put("fam", "qual", "value");
    writer.addMutation(m);
    Mutation m2 = new Mutation("r2");
    m2.put("fam", "qual", "value");
    writer.addMutation(m2);
   
    // make sure the write goes through
    writer.flush();
    writer.close();
   
View Full Code Here

Examples of org.apache.accumulo.core.client.BatchWriter.addMutation()

    BatchWriter bw = c.createBatchWriter("test", new BatchWriterConfig());
   
    for (int i = 0; i < 10; i++) {
      Mutation m1 = new Mutation("r" + i);
      m1.put("cf1", "cq1", 1, "v" + i);
      bw.addMutation(m1);
    }
   
    bw.flush();
   
    int count = 10;
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.