Package org.apache.accumulo.core.client

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


      while (iter.hasNext()) {
        Entry<Key,Value> next = iter.next();
        Key k = next.getKey();
        Mutation m = new Mutation(k.getRow());
        m.putDelete(k.getColumnFamily(), k.getColumnQualifier(), new ColumnVisibility(k.getColumnVisibility()), k.getTimestamp());
        writer.addMutation(m);
      }
    } finally {
      writer.close();
    }
  }
View Full Code Here


      r.nextBytes(rowData);
      TestIngest.toPrintableChars(rowData);
     
      Mutation mut = new Mutation(new Text(rowData));
      mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(Constants.UTF8)));
      bw.addMutation(mut);
    }
   
    bw.close();
   
    checkSplits(table, expectedSplits, expectedSplits);
View Full Code Here

    }
    state.set("totalWrites", totalWrites);
   
    Mutation m = new Mutation(new Text(String.format("%010d", totalWrites)));
    m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes(Constants.UTF8)));
    bw.addMutation(m);
  }
}
View Full Code Here

    BatchWriter bw = getConnector().createBatchWriter("test", new BatchWriterConfig());

    Mutation m1 = new Mutation("r1");
    m1.put("cf1", "cq1", 1, "5");

    bw.addMutation(m1);

    bw.flush();

    Scanner scanner = getConnector().createScanner("test", new Authorizations());
View Full Code Here

    Mutation m2 = new Mutation("r2");
    m2.put("cf1", "cq1", 1, "6");

    try {
      bw.addMutation(m1);
      bw.flush();
      throw new Exception("batch writer did not fail");
    } catch (Exception e) {

    }
View Full Code Here

          long val = (rand.nextLong() & 0x7fffffffffffffffl);
          for (int j = 0; j < 10; j++) {
            m.put("cf", "cq" + j, new Value(String.format("%016x", val).getBytes(Constants.UTF8)));
          }
         
          bw.addMutation(m);
        }
      } finally {
        bw.close();
      }
     
View Full Code Here

    for (int i = 0; i < 1000; i++) {
      Mutation m = new Mutation(new Text(String.format("%06d", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value(Integer.toString(1000 - i).getBytes(Constants.UTF8)));
      m.put(new Text("cf1"), new Text("cq2"), new Value(Integer.toString(i - 1000).getBytes(Constants.UTF8)));
     
      bw.addMutation(m);
    }
   
    bw.close();
   
    Scanner scanner = getConnector().createScanner("foo", new Authorizations());
View Full Code Here

    BatchWriter bw = getConnector().createBatchWriter("bss", new BatchWriterConfig());
   
    for (int i = 0; i < numRows; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value(String.format("%016x", numRows - i).getBytes(Constants.UTF8)));
      bw.addMutation(m);
    }
   
    bw.close();
   
    getConnector().tableOperations().flush("bss", null, null, true);
View Full Code Here

  public void run() throws Exception {
    BatchWriter bw = getConnector().createBatchWriter("cct", new BatchWriterConfig());
    for (int i = 0; i < 50; i++) {
      Mutation m = new Mutation(new Text(String.format("%06d", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes(Constants.UTF8)));
      bw.addMutation(m);
    }
   
    bw.flush();
   
    ScanTask st0 = new ScanTask(getConnector(), 300);
View Full Code Here

    getConnector().tableOperations().flush("cct", null, null, true);
   
    for (int i = 0; i < 50; i++) {
      Mutation m = new Mutation(new Text(String.format("%06d", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes(Constants.UTF8)));
      bw.addMutation(m);
    }
   
    bw.flush();
   
    ScanTask st2 = new ScanTask(getConnector(), 100);
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.