Package org.apache.accumulo.core.client

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


    // now add mutation to index
    Text row = new Text(hash);
    m = new Mutation(row);
    m.put(META_COLUMN_FAMILY, UUID_COLUMN_QUALIFIER, new Value(uuid.getBytes(Constants.UTF8)));
   
    indexBW.addMutation(m);
   
    Text lastRow = (Text) state.get("lastIndexRow");
    if (lastRow.compareTo(row) < 0) {
      state.set("lastIndexRow", new Text(row));
    }
View Full Code Here


        getConnector().tableOperations().create(TEST_TABLE);
        // put in some initial data
        BatchWriter writer = getConnector().createBatchWriter(TEST_TABLE, new BatchWriterConfig());
        Mutation m = new Mutation(new Text("row"));
        m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes(Constants.UTF8)));
        writer.addMutation(m);
        writer.close();
       
        // verify proper permissions for creator and test user
        verifyHasOnlyTheseTablePermissions(getConnector(), getConnector().whoami(), TEST_TABLE, TablePermission.values());
        verifyHasNoTablePermissions(getConnector(), TEST_USER, TEST_TABLE, TablePermission.values());
View Full Code Here

        case WRITE:
          try {
            writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
            m = new Mutation(new Text("row"));
            m.put(new Text("a"), new Text("b"), new Value("c".getBytes(Constants.UTF8)));
            writer.addMutation(m);
            try {
              writer.close();
            } catch (MutationsRejectedException e1) {
              if (e1.getAuthorizationFailuresMap().size() > 0)
                throw new AccumuloSecurityException(test_user_conn.whoami(), org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.PERMISSION_DENIED,
View Full Code Here

          break;
        case WRITE:
          writer = test_user_conn.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
          m = new Mutation(new Text("row"));
          m.put(new Text("a"), new Text("b"), new Value("c".getBytes(Constants.UTF8)));
          writer.addMutation(m);
          writer.close();
          break;
        case BULK_IMPORT:
          // test for bulk import permission would go here
          break;
View Full Code Here

    BatchWriter bw = getConnector().createBatchWriter("tt", new BatchWriterConfig());
   
    Mutation m = new Mutation(new Text("r1"));
    m.put(new Text("acf"), new Text("foo"), new Value(new byte[] {'1'}));
   
    bw.addMutation(m);
   
    bw.close();
   
    // try to scan table
    Scanner scanner = getConnector().createScanner("tt", Constants.NO_AUTHS);
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);
    }
    bw.close();
  }

  private void assertTrue(boolean b) {
View Full Code Here

      Mutation m1 = new Mutation("foo");
      m1.put("col1", "", "val1");
      m1.put("col2", "", "val2");

      bw1.addMutation(m1);
      bw2.addMutation(m1);

      tops.offline(table1);

      try {
View Full Code Here

      Mutation m1 = new Mutation("foo");
      m1.put("col1", "", "val1");
      m1.put("col2", "", "val2");

      bw1.addMutation(m1);
      bw2.addMutation(m1);

      // Mutations might or might not flush before tables goes offline
      tops.offline(table1);
      tops.offline(table2);
View Full Code Here

    while (rowids.size() < opts.num) {
      rowids.add((Math.abs(r.nextLong()) % (opts.max - opts.min)) + opts.min);
    }
    for (long rowid : rowids) {
      Mutation m = createMutation(rowid, opts.size, cv);
      bw.addMutation(m);
    }
   
    try {
      bw.close();
    } catch (MutationsRejectedException e) {
View Full Code Here

              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
              currentRow = metadataRow;
            }
           
            if (!currentRow.equals(metadataRow)) {
              mbw.addMutation(m);
              m = new Mutation(metadataRow);
              Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
            }
           
            m.put(key.getColumnFamily(), cq, val);
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.