Package org.apache.accumulo.core.client

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


            }
           
            m.put(key.getColumnFamily(), cq, val);
           
            if (endRow == null && Constants.METADATA_PREV_ROW_COLUMN.hasColumns(key)) {
              mbw.addMutation(m);
              break; // its the last column in the last row
            }
          }
         
          break;
View Full Code Here


    for (int i = 0; i < 100000; i++) {
      Mutation m = new Mutation(new Text(String.format("%08d", i)));
      for (int j = 0; j < 3; j++)
        m.put(new Text("cf1"), new Text("cq" + j), new Value((i + "_" + j).getBytes(Constants.UTF8)));
     
      bw.addMutation(m);
    }
   
    bw.close();
   
    Scanner scanner = getConnector().createScanner("abc", new Authorizations());
View Full Code Here

    // Trace the write operation. Note, unless you flush the BatchWriter, you will not capture
    // the write operation as it is occurs asynchronously. You can optionally create additional Spans
    // within a given Trace as seen below around the flush
    Trace.on("Client Write");

    batchWriter.addMutation(m);
    Span flushSpan = Trace.start("Client Flush");
    batchWriter.flush();
    flushSpan.stop();

    // Use Trace.offNoFlush() if you don't want the operation to block.
View Full Code Here

   
    BatchWriter bw = getConnector().createBatchWriter("scftt", new BatchWriterConfig());
   
    // create file in the tablet that has mostly column family 0, with a few entries for column family 1

    bw.addMutation(nm(0, 1, 0));
    for (int i = 1; i < 99999; i++) {
      bw.addMutation(nm(i * 2, 0, i));
    }
    bw.addMutation(nm(99999 * 2, 1, 99999));
    bw.flush();
View Full Code Here

   
    // create file in the tablet that has mostly column family 0, with a few entries for column family 1

    bw.addMutation(nm(0, 1, 0));
    for (int i = 1; i < 99999; i++) {
      bw.addMutation(nm(i * 2, 0, i));
    }
    bw.addMutation(nm(99999 * 2, 1, 99999));
    bw.flush();
   
    getConnector().tableOperations().flush("scftt", null, null, true);
View Full Code Here

    bw.addMutation(nm(0, 1, 0));
    for (int i = 1; i < 99999; i++) {
      bw.addMutation(nm(i * 2, 0, i));
    }
    bw.addMutation(nm(99999 * 2, 1, 99999));
    bw.flush();
   
    getConnector().tableOperations().flush("scftt", null, null, true);
   
    // create a file that has column family 1 and 0 interleaved
View Full Code Here

    BatchWriter bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
   
    Mutation m = new Mutation(new Text("r1"));
    m.put(new Text("acf"), new Text("foo"), new Value("1".getBytes(Constants.UTF8)));
   
    bw.addMutation(m);
   
    bw.close();
   
    getConnector().tableOperations().flush("foo", null, null, false);
    UtilWaitThread.sleep(1000);
View Full Code Here

    // now try putting bad iterator back and deleting the table
    getConnector().tableOperations().setProperty("foo", Property.TABLE_ITERATOR_PREFIX.getKey() + "minc.badi", "30," + BadIterator.class.getName());
    bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
    m = new Mutation(new Text("r2"));
    m.put(new Text("acf"), new Text("foo"), new Value("1".getBytes(Constants.UTF8)));
    bw.addMutation(m);
    bw.close();
   
    // make sure property is given time to propagate
    UtilWaitThread.sleep(1000);
   
View Full Code Here

    BatchWriter bw = getConnector().createBatchWriter("ct", new BatchWriterConfig());
   
    Mutation mut1 = new Mutation(new Text("r1"));
    mut1.put(new Text("cf1"), new Text("cq1"), new Value("123".getBytes(Constants.UTF8)));
   
    bw.addMutation(mut1);
   
    // should not throw any exceptions
    bw.close();
   
    bw = getConnector().createBatchWriter("ct", new BatchWriterConfig());
View Full Code Here

   
    // create a mutation with a non numeric value
    Mutation mut2 = new Mutation(new Text("r1"));
    mut2.put(new Text("cf1"), new Text("cq1"), new Value("123a".getBytes(Constants.UTF8)));
   
    bw.addMutation(mut2);
   
    boolean sawMRE = false;
   
    try {
      bw.close();
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.