Package org.apache.accumulo.core.client

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


  }
 
  @Override
  public void run() throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
   
    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(("" + (1000 - i)).getBytes()));
      m.put(new Text("cf1"), new Text("cq2"), new Value(("" + (i - 1000)).getBytes()));
View Full Code Here


    // handle columns
    fetchColumns(cl, scanner, interpeter);
   
    // output / delete the records
    final BatchWriter writer = shellState.getConnector()
        .createBatchWriter(tableName, new BatchWriterConfig().setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS));
    shellState.printLines(new DeleterFormatter(writer, scanner, cl.hasOption(timestampOpt.getOpt()), shellState, cl.hasOption(forceOpt.getOpt())), false);
   
    return 0;
  }
View Full Code Here

    return Collections.singletonList(new TableSetup("abc"));
  }
 
  @Override
  public void run() throws Exception {
    BatchWriter bw = getConnector().createBatchWriter("abc", new BatchWriterConfig());
   
    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()));
View Full Code Here

 
  @Override
  public void run() throws Exception {
    getConnector().tableOperations().create("scftt");
   
    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++) {
View Full Code Here

    conn.tableOperations().addConstraint("foo1", SlowConstraint.class.getName());
   
    // give constraint time to propogate through zookeeper
    UtilWaitThread.sleep(250);
   
    BatchWriter bw = conn.createBatchWriter("foo1", new BatchWriterConfig().setTimeout(3, TimeUnit.SECONDS));
   
    Mutation mut = new Mutation("r1");
    mut.put("cf1", "cq1", "v1");
   
    bw.addMutation(mut);
View Full Code Here

  }
 
  public void testBatchScannerTimeout() throws Exception {
    getConnector().tableOperations().create("timeout");
   
    BatchWriter bw = getConnector().createBatchWriter("timeout", new BatchWriterConfig());
   
    Mutation m = new Mutation("r1");
    m.put("cf1", "cq1", "v1");
    m.put("cf1", "cq2", "v2");
    m.put("cf1", "cq3", "v3");
View Full Code Here

    getConnector().tableOperations().create("tt");
    IteratorSetting is = new IteratorSetting(5, "Bad Aggregator", BadCombiner.class);
    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("acf")));
    getConnector().tableOperations().attachIterator("tt", is);
   
    BatchWriter bw = getConnector().createBatchWriter("tt", new BatchWriterConfig());
   
    Mutation m = new Mutation(new Text("r1"));
    m.put(new Text("acf"), new Text("foo"), new Value("1".getBytes()));
   
    bw.addMutation(m);
View Full Code Here

    }

  }
 
  private void fillTable(String table) throws Exception {
    BatchWriter bw = getConnector().createBatchWriter(TABLE, new BatchWriterConfig());
    for (String row : ROWS) {
      Mutation m = new Mutation(row);
      m.put("cf", "cq", "value");
      bw.addMutation(m);
    }
View Full Code Here

  }
 
  @Override
  public void run() throws Exception {
   
    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()));
   
    bw.addMutation(m);
   
    bw.close();
   
    getConnector().tableOperations().flush("foo", null, null, false);
    UtilWaitThread.sleep(1000);
   
    // minc should fail, so there should be no files
    checkRFiles("foo", 1, 1, 0, 0);
   
    // try to scan table
    Scanner scanner = getConnector().createScanner("foo", Constants.NO_AUTHS);
   
    int count = 0;
    for (@SuppressWarnings("unused")
    Entry<Key,Value> entry : scanner) {
      count++;
    }
   
    if (count != 1)
      throw new Exception("Did not see expected # entries " + count);
   
    // remove the bad iterator
    getConnector().tableOperations().removeProperty("foo", Property.TABLE_ITERATOR_PREFIX.getKey() + "minc.badi");
   
    UtilWaitThread.sleep(5000);
   
    // minc should complete
    checkRFiles("foo", 1, 1, 1, 1);
   
    count = 0;
    for (@SuppressWarnings("unused")
    Entry<Key,Value> entry : scanner) {
      count++;
    }
   
    if (count != 1)
      throw new Exception("Did not see expected # entries " + count);
   
    // 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()));
    bw.addMutation(m);
    bw.close();
   
View Full Code Here

    }
   
  }
 
  private void insertData(long ts) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, MutationsRejectedException {
    BatchWriter bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
   
    for (int i = 0; i < 10000; i++) {
      String row = String.format("%09d", i);
     
      Mutation m = new Mutation(new Text(row));
View Full Code Here

TOP

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

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.