Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Mutation


    BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
    for (Entry<Key,Value> entry : mscanner) {
      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


    return ret;
  }
 
  public static void addBulkLoadInProgressFlag(String path) {

    Mutation m = new Mutation(Constants.METADATA_BLIP_FLAG_PREFIX + path);
    m.put(EMPTY_TEXT, EMPTY_TEXT, new Value(new byte[] {}));

    update(SecurityConstants.getSystemCredentials(), m);
  }
View Full Code Here

    update(SecurityConstants.getSystemCredentials(), m);
  }

  public static void removeBulkLoadInProgressFlag(String path) {

    Mutation m = new Mutation(Constants.METADATA_BLIP_FLAG_PREFIX + path);
    m.putDelete(EMPTY_TEXT, EMPTY_TEXT);

    update(SecurityConstants.getSystemCredentials(), m);
  }
View Full Code Here

      String row = entry.getKey().getRow().toString();
      if (row.startsWith(Constants.METADATA_DELETE_FLAG_PREFIX + "/" + Constants.METADATA_TABLE_ID)) {
        String filename = row.substring(Constants.METADATA_DELETE_FLAG_PREFIX.length());
        // add the new entry first
        log.info("Moving " + filename + " marker to the root tablet");
        Mutation m = new Mutation(Constants.METADATA_DELETE_FLAG_FOR_METADATA_PREFIX + filename);
        m.put(new byte[]{}, new byte[]{}, new byte[]{});
        update(creds, m);
        // remove the old entry
        m = new Mutation(entry.getKey().getRow());
        m.putDelete(new byte[]{}, new byte[]{});
        update(creds, m);
      } else {
        break;
      }
    }
View Full Code Here

  private void insertData(String table) throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
   
    for (int i = 0; i < ROW_LIMIT; i++) {
      Mutation m = new Mutation(createRow(i));
     
      for (int j = 0; j < CF_LIMIT; j++) {
        for (int k = 0; k < CQ_LIMIT; k++) {
          for (int t = 0; t < TS_LIMIT; t++) {
            m.put(createCF(j), createCQ(k), t, new Value(String.format("%06d_%03d_%03d_%03d", i, j, k, t).getBytes(Constants.UTF8)));
          }
        }
      }
     
      bw.addMutation(m);
View Full Code Here

  }
 
  private void insertData() throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter("vt", new BatchWriterConfig());
    Mutation m1 = new Mutation(new Text("row1"));
   
    mput(m1, "cf1", "cq1", "", "v1");
    mput(m1, "cf1", "cq1", "A", "v2");
    mput(m1, "cf1", "cq1", "B", "v3");
    mput(m1, "cf1", "cq1", "A&B", "v4");
View Full Code Here

  }
 
  private void deleteData() throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter("vt", new BatchWriterConfig());
    Mutation m1 = new Mutation(new Text("row1"));
   
    mputDelete(m1, "cf1", "cq1", "");
    mputDelete(m1, "cf1", "cq1", "A");
    mputDelete(m1, "cf1", "cq1", "A&B");
    mputDelete(m1, "cf1", "cq1", "B&(L|M)");
View Full Code Here

    queryData(nss("A", "B", "FOO", "L", "M", "Z"), nss("A", "B", "FOO", "L", "M", "Z"), expected);
  }
 
  private void insertDefaultData() throws Exception {
    BatchWriter bw = getConnector().createBatchWriter("vt2", new BatchWriterConfig());
    Mutation m1 = new Mutation(new Text("row1"));
   
    mput(m1, "cf1", "cq1", "BASE", "v1");
    mput(m1, "cf1", "cq2", "DEFLABEL", "v2");
    mput(m1, "cf1", "cq3", "", "v3");
   
View Full Code Here

        byte[] val = data.get();
       
        int offset = ContinuousWalk.getPrevRowOffset(val);
        if (offset > 0) {
          long rowLong = Long.parseLong(new String(val, offset, 16, Constants.UTF8), 16);
          Mutation m = ContinuousIngest.genMutation(rowLong, random.nextInt(max_cf), random.nextInt(max_cq), EMPTY_VIS, iiId, count++, key.getRowData()
              .toArray(), random, true);
          context.write(null, m);
        }
       
      } else {
View Full Code Here

    }
  }

  public List<Mutation> createMutations() {
    List<Mutation> mutations = new LinkedList<Mutation>();
    Mutation m = new Mutation("0");
    m.put("cf1", "cq1", "1");
    m.put("cf1", "cq2", "1");
    m.put("cf1", "cq3", "1");
    m.put("cf1", "cq4", "1");
    m.put("cf1", "cq5", "1");
    m.put("cf1", "cq6", "1");
    m.put("cf1", "cq7", "1");
    m.put("cf1", "cq8", "1");
    m.put("cf1", "cq9", "1");
    m.put("cf2", "cq1", "1");
    m.put("cf2", "cq2", "1");
    mutations.add(m);

    m = new Mutation("1");
    m.put("cf1", "cq1", "1");
    m.put("cf1", "cq2", "2");
    mutations.add(m);

    m = new Mutation("2");
    m.put("cf1", "cq1", "1");
    m.put("cf1", "cq2", "1");
    mutations.add(m);

    m = new Mutation("3");
    m.put("cf1", "cq1", "0");
    m.put("cf1", "cq2", "2");
    mutations.add(m);

    m = new Mutation("4");
    m.put("cf1", "cq1", "1");
    m.put("cf1", "cq2", "1");
    m.put("cf1", "cq3", "1");
    m.put("cf1", "cq4", "1");
    m.put("cf1", "cq5", "1");
    m.put("cf1", "cq6", "1");
    m.put("cf1", "cq7", "1");
    m.put("cf1", "cq8", "1");
    m.put("cf1", "cq9", "1");
    m.put("cf2", "cq1", "1");
    m.put("cf2", "cq2", "1");

    mutations.add(m);
    return mutations;
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.Mutation

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.