Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Mutation.toThrift()


              long size = 0;
              Iterator<Mutation> iter = entry.getValue().iterator();
              while (iter.hasNext()) {
                while (size < MUTATION_BATCH_SIZE && iter.hasNext()) {
                  Mutation mutation = iter.next();
                  updates.add(mutation.toThrift());
                  size += mutation.numBytes();
                }
               
                client.applyUpdates(tinfo, usid, entry.getKey().toThrift(), updates);
                updates.clear();
View Full Code Here


            long size = 0;
            Iterator<Mutation> iter = entry.getValue().iterator();
            while (iter.hasNext()) {
              while (size < MUTATION_BATCH_SIZE && iter.hasNext()) {
                Mutation mutation = iter.next();
                updates.add(mutation.toThrift());
                size += mutation.numBytes();
              }
             
              client.applyUpdates(null, usid, entry.getKey().toThrift(), updates);
              updates.clear();
View Full Code Here

    try {
      TabletClientService.Iface client = ThriftUtil.getTServerClient(opts.location, conf.getConfiguration());
     
      Mutation mutation = new Mutation(new Text("row_0003750001"));
      mutation.putDelete(new Text("colf"), new Text("colq"));
      client.update(Tracer.traceInfo(), CredentialHelper.create(opts.principal, opts.getToken(), opts.instance), new KeyExtent(new Text("!!"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
}
View Full Code Here

            long size = 0;
            Iterator<Mutation> iter = entry.getValue().iterator();
            while (iter.hasNext()) {
              while (size < MUTATION_BATCH_SIZE && iter.hasNext()) {
                Mutation mutation = iter.next();
                updates.add(mutation.toThrift());
                size += mutation.numBytes();
              }
             
              client.applyUpdates(null, usid, entry.getKey().toThrift(), updates);
              updates.clear();
View Full Code Here

      TabletClientService.Iface client = ThriftUtil.getTServerClient(location, ServerConfiguration.getSystemConfiguration());
     
      Mutation mutation = new Mutation(new Text("row_0003750001"));
      // mutation.set(new Text("colf:colq"), new Value("val".getBytes()));
      mutation.putDelete(new Text("colf"), new Text("colq"));
      client.update(null, rootCredentials, new KeyExtent(new Text("test_ingest"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
}
View Full Code Here

    }
    assertTrue(fs.exists(mylog));
    Mutation m = new Mutation(new Text("row1"));
    m.put(new Text("cf"), new Text("cq"), new Value("value".getBytes()));
    try {
      writer.log(null, logFile.id, 1, 0, m.toThrift());
      fail("writing to a log after it has been copied to hdfs should fail");
    } catch (NoSuchLogIDException ex) {
      // ignored
    }
    fs.delete(mylog, true);
View Full Code Here

  @Test
  public void testLog() throws Exception {
    LogFile logFile = writer.create(null, CREDENTIALS, "");
    Mutation m = new Mutation(new Text("somerow"));
    m.put(new Text("cf1"), new Text("cq1"), new Value("value1".getBytes()));
    writer.log(null, logFile.id, 2, 42, m.toThrift());
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
View Full Code Here

    LogFile logFile = writer.create(null, CREDENTIALS, "");
    List<TMutation> all = new ArrayList<TMutation>();
    for (int i = 0; i < 10; i++) {
      Mutation m = new Mutation(new Text("somerow"));
      m.put(new Text("cf" + i), new Text("cq" + i), new Value(("value" + i).getBytes()));
      all.add(m.toThrift());
    }
    List<TabletMutations> updates = new ArrayList<TabletMutations>();
    updates.add(new TabletMutations(13, 3, all));
    writer.logManyTablets(null, logFile.id, updates);
    writer.close(null, logFile.id);
View Full Code Here

              long size = 0;
              Iterator<Mutation> iter = entry.getValue().iterator();
              while (iter.hasNext()) {
                while (size < MUTATION_BATCH_SIZE && iter.hasNext()) {
                  Mutation mutation = iter.next();
                  updates.add(mutation.toThrift());
                  size += mutation.numBytes();
                }
               
                client.applyUpdates(tinfo, usid, entry.getKey().toThrift(), updates);
                updates.clear();
View Full Code Here

              long size = 0;
              Iterator<Mutation> iter = entry.getValue().iterator();
              while (iter.hasNext()) {
                while (size < MUTATION_BATCH_SIZE && iter.hasNext()) {
                  Mutation mutation = iter.next();
                  updates.add(mutation.toThrift());
                  size += mutation.numBytes();
                }
               
                client.applyUpdates(tinfo, usid, entry.getKey().toThrift(), updates);
                updates.clear();
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.