Package org.apache.accumulo.core.data

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


    for (Entry<Key,Value> entry : mscanner) {
      Key k = entry.getKey();
      Mutation m = new Mutation(k.getRow());
      m.putDelete(k.getColumnFamily(), k.getColumnQualifier());
      Constants.METADATA_DIRECTORY_COLUMN.put(m, new Value(FastFormat.toZeroPaddedString(dirCount++, 8, 16, "/c-".getBytes(Constants.UTF8))));
      bw.addMutation(m);
    }

    bw.close();
View Full Code Here


  }

  public static void chopped(KeyExtent extent, ZooLock zooLock) {
    Mutation m = new Mutation(extent.getMetadataEntry());
    Constants.METADATA_CHOPPED_COLUMN.put(m, new Value("chopped".getBytes(Constants.UTF8)));
    update(SecurityConstants.getSystemCredentials(), zooLock, m);
  }
View Full Code Here

  }
 
  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

      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

    return ts;
  }
 
  private void mput(Mutation m, String cf, String cq, String cv, String val) {
    ColumnVisibility le = new ColumnVisibility(cv.getBytes(Constants.UTF8));
    m.put(new Text(cf), new Text(cq), le, new Value(val.getBytes(Constants.UTF8)));
  }
View Full Code Here

import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.Combiner;

public class TestCombiner extends Combiner {
    public Value reduce(Key key, Iterator<Value> iter) {
        return new Value("TestY".getBytes());
    }
View Full Code Here

            }
           
            bytesWritten += key.getSize();
           
            if (opts.delete) {
              writer.append(key, new Value(new byte[0]));
            } else {
              byte value[];
              if (opts.random != null) {
                value = genRandomValue(random, randomValue, opts.random.intValue(), rowid + opts.startRow, j);
              } else {
                value = bytevals[j % bytevals.length];
              }
             
              Value v = new Value(value);
              writer.append(key, v);
              bytesWritten += v.getSize();
            }
           
          } else {
            Key key = new Key(row, colf, colq, labBA);
            bytesWritten += key.getSize();
           
            if (opts.delete) {
              if (opts.timestamp >= 0)
                m.putDelete(colf, colq, opts.columnVisibility, opts.timestamp);
              else
                m.putDelete(colf, colq, opts.columnVisibility);
            } else {
              byte value[];
              if (opts.random != null) {
                value = genRandomValue(random, randomValue, opts.random.intValue(), rowid + opts.startRow, j);
              } else {
                value = bytevals[j % bytevals.length];
              }
              bytesWritten += value.length;
             
              if (opts.timestamp >= 0) {
                m.put(colf, colq, opts.columnVisibility, opts.timestamp, new Value(value, true));
              } else {
                m.put(colf, colq, opts.columnVisibility, new Value(value, true));
               
              }
            }
          }
         
View Full Code Here

    MetadataTable.getMetadataTable(SecurityConstants.getSystemCredentials()).update(m);
  }
 
  void saveToMetadataTable() throws Exception {
    Mutation m = new Mutation(new Text("~err_" + tableName));
    m.put(new Text(problemType.name()), new Text(resource), new Value(encode()));
    MetadataTable.getMetadataTable(SecurityConstants.getSystemCredentials()).update(m);
  }
View Full Code Here

      for (ColumnUpdate update : m.getUpdates()) {
        cf.set(update.getColumnFamily());
        cq.set(update.getColumnQualifier());

        Key k = new Key(row, cf, cq);
        Value v = new Value(update.getValue());

        keyValues.put(k, v);
      }
    }
View Full Code Here

    filter.seek(new Range(), Collections.<ByteSequence> emptySet(), false);

    // Save off the first key and value
    Key firstKey = filter.getTopKey();
    Value firstValue = filter.getTopValue();

    // Assert that the row is valid given our filter
    assertEquals("0", firstKey.getRow().toString());

    // Read some extra data, just making sure it's all valid
    Key lastKeyRead = null;
    for (int i = 0; i < 5; i++) {
      filter.next();
      lastKeyRead = filter.getTopKey();
      assertEquals("0", lastKeyRead.getRow().toString());
    }

    // Make a copy of the original RowFilter
    RowFilter copy = (RowFilter) filter.deepCopy(new DefaultIteratorEnvironment());

    // Because it's a copy, we should be able to safely seek this one without affecting the original
    copy.seek(new Range(), Collections.<ByteSequence> emptySet(), false);

    assertTrue("deepCopy'ed RowFilter did not have a top key", copy.hasTop());

    Key firstKeyFromCopy = copy.getTopKey();
    Value firstValueFromCopy = copy.getTopValue();

    // Verify that we got the same first k-v pair we did earlier
    assertEquals(firstKey, firstKeyFromCopy);
    assertEquals(firstValue, firstValueFromCopy);
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.