Package org.apache.accumulo.core.client

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


    Text cf = new Text("cf1");
    Text cq = new Text("cq1");
   
    getConnector().tableOperations().create("t1");
    getConnector().tableOperations().addSplits("t1", splits);
    BatchWriter bw = getConnector().createBatchWriter("t1", new BatchWriterConfig());
   
    for (int i = 1; i < 257; i++) {
      Mutation m = new Mutation(new Text(String.format("%08x", (i << 8) - 16)));
      m.put(cf, cq, new Value(Integer.toString(i).getBytes(Constants.UTF8)));
     
View Full Code Here


   
    extents.add(new KeyExtent(tid, null, per));
   
    if (args[0].equals("write")) {
     
      BatchWriter bw = connector.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
      for (KeyExtent extent : extents) {
        Mutation mut = extent.getPrevRowUpdateMutation();
        new TServerInstance(AddressUtil.parseAddress("192.168.1.100", 4567), "DEADBEEF").putLocation(mut);
        bw.addMutation(mut);
      }
     
      bw.close();
    } else if (args[0].equals("writeFiles")) {
      BatchWriter bw = connector.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
     
      for (KeyExtent extent : extents) {
       
        Mutation mut = new Mutation(extent.getMetadataEntry());
       
View Full Code Here

    job.setNumReduceTasks(0);

    job.setOutputFormatClass(AccumuloOutputFormat.class);
    opts.setAccumuloConfigs(job);
    BatchWriterConfig bwConfig = new BatchWriterConfig().setMaxMemory(10L * 1000 * 1000);
    AccumuloOutputFormat.setBatchWriterOptions(job, bwConfig);

    Configuration conf = job.getConfiguration();
    conf.setLong(NUMROWS, opts.numRows);
    conf.setInt("cloudgen.minkeylength", opts.minKeyLength);
View Full Code Here

   
    // Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
   
    int numRows = 1 << 18;
   
    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()));
      bw.addMutation(m);
View Full Code Here

   * Scan 0 |------------------------------| Scan 1 |----------| Minc 1 |-----| Scan 2 |----------| Scan 3 |---------------| Minc 2 |-----| Majc 1 |-----|
   */
 
  @Override
  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()));
      bw.addMutation(m);
    }
View Full Code Here

   * @since 1.5.0
   * @see #setBatchWriterOptions(Class, Configuration, BatchWriterConfig)
   */
  public static BatchWriterConfig getBatchWriterOptions(Class<?> implementingClass, Configuration conf) {
    String serialized = conf.get(enumToConfKey(implementingClass, WriteOpts.BATCH_WRITER_CONFIG));
    BatchWriterConfig bwConfig = new BatchWriterConfig();
    if (serialized == null || serialized.isEmpty()) {
      return bwConfig;
    } else {
      try {
        ByteArrayInputStream bais = new ByteArrayInputStream(serialized.getBytes(Charset.forName("UTF-8")));
        bwConfig.readFields(new DataInputStream(bais));
        bais.close();
        return bwConfig;
      } catch (IOException e) {
        throw new IllegalArgumentException("unable to serialize " + BatchWriterConfig.class.getName());
      }
View Full Code Here

    write("bt1", 1, 0, 1000000000, 1000);
    write("bt2", 2, 0, 1000000000, 1000);
    write("bt3", 3, 0, 1000000000, 1000);
   
    // test inserting an empty key
    BatchWriter bw = getConnector().createBatchWriter("bt4", new BatchWriterConfig());
    Mutation m = new Mutation(new Text(""));
    m.put(new Text(""), new Text(""), new Value("foo1".getBytes()));
    bw.addMutation(m);
    bw.close();
    getConnector().tableOperations().flush("bt4", null, null, true);
View Full Code Here

    return t2 - t1;
  }
 
  private void write(String table, int depth, long start, long end, int step) throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
   
    for (long i = start; i < end; i += step) {
      String key = String.format("k_%010d", i);
     
      Mutation m = null;
View Full Code Here

    Text cf = new Text("cf1");
    Text cq = new Text("cq1");
   
    getConnector().tableOperations().create("t1");
    getConnector().tableOperations().addSplits("t1", splits);
    BatchWriter bw = getConnector().createBatchWriter("t1", new BatchWriterConfig());
   
    for (int i = 1; i < 257; i++) {
      Mutation m = new Mutation(new Text(String.format("%08x", (i << 8) - 16)));
      m.put(cf, cq, new Value(("" + i).getBytes()));
     
View Full Code Here

    for (String split : splits) {
      splitSet.add(new Text(split));
    }
    conn.tableOperations().addSplits(table, splitSet);
   
    BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
    for (String row : inserts) {
      Mutation m = new Mutation(row);
      m.put("cf", "cq", "v");
      bw.addMutation(m);
    }
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.