Package org.apache.accumulo.core.data

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


          serversWaitedForWrites.get(ttype).add(server);
       
        Key.decompress(isr.result.results);
       
        for (TKeyValue kv : isr.result.results)
          results.put(new Key(kv.key), new Value(kv.value));
       
        client.closeScan(tinfo, isr.scanID);
       
        return isr.result.more;
      } finally {
View Full Code Here


     
      r.nextBytes(rowData);
      TestIngest.toPrintableChars(rowData);
     
      Mutation mut = new Mutation(new Text(rowData));
      mut.put(new Text(""), new Text(""), new Value(Integer.toString(i).getBytes(Constants.UTF8)));
      bw.addMutation(mut);
    }
   
    bw.close();
   
View Full Code Here

      log.debug("Total writes: " + totalWrites);
    }
    state.set("totalWrites", totalWrites);
   
    Mutation m = new Mutation(new Text(String.format("%010d", totalWrites)));
    m.put(new Text("cf"), new Text("cq"), new Value("val".getBytes(Constants.UTF8)));
    bw.addMutation(m);
  }
View Full Code Here

    opts.parseArgs(Verify.class.getName(), args);
    Scanner scanner = opts.getConnector().createScanner(opts.tableName, opts.auths);
    scanner.fetchColumnFamily(BulkPlusOne.CHECK_COLUMN_FAMILY);
    Text startBadRow = null;
    Text lastBadRow = null;
    Value currentBadValue = null;
    for (Entry<Key,Value> entry : scanner) {
      // System.out.println("Entry: " + entry);
      byte[] value = entry.getValue().get();
      if (!Arrays.equals(value, zero)) {
        if (currentBadValue == null || entry.getValue().equals(currentBadValue)) {
          // same value, keep skipping ahead
          lastBadRow = new Text(entry.getKey().getRow());
          if (startBadRow == null)
            startBadRow = lastBadRow;
        } else {
          // new bad value, report
          report(startBadRow, lastBadRow, currentBadValue);
          startBadRow = lastBadRow = new Text(entry.getKey().getRow());
        }
        currentBadValue = new Value(entry.getValue());
      } else {
        // end of bad range, report
        if (startBadRow != null) {
          report(startBadRow, lastBadRow, currentBadValue);
        }
View Full Code Here

      writeMutation(output, start, index);
    }
   
    public void writeMutation(Context output, int start, int end) throws IOException, InterruptedException {
      Mutation m = new Mutation(new Text(String.format("%010d", start)));
      m.put(new Text(String.format("%010d", end)), new Text(""), new Value(new byte[0]));
      output.write(null, m);
    }
View Full Code Here

        int numRows = rand.nextInt(100000);
        for (int i = 0; i < numRows; i++) {
          Mutation m = new Mutation(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl)));
          long val = (rand.nextLong() & 0x7fffffffffffffffl);
          for (int j = 0; j < 10; j++) {
            m.put("cf", "cq" + j, new Value(String.format("%016x", val).getBytes(Constants.UTF8)));
          }
         
          bw.addMutation(m);
        }
      } finally {
View Full Code Here

   
    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(Integer.toString(1000 - i).getBytes(Constants.UTF8)));
      m.put(new Text("cf1"), new Text("cq2"), new Value(Integer.toString(i - 1000).getBytes(Constants.UTF8)));
     
      bw.addMutation(m);
    }
   
    bw.close();
View Full Code Here

    @Override
    public void addMutation(Mutation m) throws MutationsRejectedException {
      List<ColumnUpdate> updates = m.getUpdates();
      for (ColumnUpdate cu : updates) {
        Key key = new Key(m.getRow(), cu.getColumnFamily(), cu.getColumnQualifier(), cu.getColumnVisibility(), Long.MAX_VALUE, false, false);
        Value val = new Value(cu.getValue(), false);
       
        try {
          writer.append(key, val);
        } catch (IOException e) {
          throw new RuntimeException(e);
View Full Code Here

    // should automatically flush after 3 seconds
    BatchWriter bw = getConnector().createBatchWriter("bwlt", new BatchWriterConfig().setMaxLatency(2000, TimeUnit.MILLISECONDS));
    Scanner scanner = getConnector().createScanner("bwlt", Constants.NO_AUTHS);
   
    Mutation m = new Mutation(new Text(String.format("r_%10d", 1)));
    m.put(new Text("cf"), new Text("cq"), new Value("1".getBytes(Constants.UTF8)));
    bw.addMutation(m);
   
    UtilWaitThread.sleep(1000);
   
    int count = 0;
View Full Code Here

    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < NUM_TO_FLUSH; j++) {
        int row = i * NUM_TO_FLUSH + j;
       
        Mutation m = new Mutation(new Text(String.format("r_%10d", row)));
        m.put(new Text("cf"), new Text("cq"), new Value(("" + row).getBytes()));
        bw.addMutation(m);
      }
     
      bw.flush();
     
View Full Code Here

TOP

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

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.