Examples of ByteRange


Examples of org.apache.hadoop.hbase.util.ByteRange

  public TestTokenizer(TestTokenizerData sortedByteArrays) {
    this.inputs = sortedByteArrays.getInputs();
    this.builder = new Tokenizer();
    for (byte[] array : inputs) {
      builder.addSorted(new ByteRange(array));
    }
    this.roundTripped = builder.getArrays();
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  }

  protected void testInternal(List<String> inputs, int expectedTreeDepth) {
    Tokenizer builder = new Tokenizer();
    for (String s : inputs) {
      ByteRange b = new ByteRange(Bytes.toBytes(s));
      builder.addSorted(b);
    }
    Assert.assertEquals(1, builder.getRoot().getNodeDepth());
    Assert.assertEquals(expectedTreeDepth, builder.getTreeDepth());
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  public TestColumnDataRandom(int numColumns) {
    RedundantKVGenerator generator = new RedundantKVGenerator();
    ByteRangeSet sortedColumns = new ByteRangeTreeSet();
    List<KeyValue> d = generator.generateTestKeyValues(numColumns);
    for (KeyValue col : d) {
      ByteRange colRange = new ByteRange(col.getQualifier());
      inputs.add(colRange);
      sortedColumns.add(colRange);
    }
    for (ByteRange col : sortedColumns.compile().getSortedRanges()) {
      outputs.add(col);
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

public class TestByteRange {

  @Test
  public void testConstructor() {
    ByteRange b = new ByteRange(new byte[] { 0, 1, 2 });
    Assert.assertEquals(3, b.getLength());
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  /************* methods ********************************/

  @Test
  public void testReaderRoundTrip() throws IOException {
    for (int i = 0; i < sortedUniqueColumns.size(); ++i) {
      ByteRange column = sortedUniqueColumns.get(i);
      builder.addSorted(column);
    }
    List<byte[]> builderOutputArrays = builder.getArrays();
    for (int i = 0; i < builderOutputArrays.size(); ++i) {
      byte[] inputArray = sortedUniqueColumns.get(i).deepCopyToNewArray();
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  /***************** construct ***********************/

  public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) {
    // used during cell accumulation
    this.blockMeta = new PrefixTreeBlockMeta();
    this.rowRange = new ByteRange();
    this.familyRange = new ByteRange();
    this.qualifierRange = new ByteRange();
    this.timestamps = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.mvccVersions = new long[INITIAL_PER_CELL_ARRAY_SIZES];
    this.typeBytes = new byte[INITIAL_PER_CELL_ARRAY_SIZES];
    this.valueOffsets = new int[INITIAL_PER_CELL_ARRAY_SIZES];
    this.values = new byte[VALUE_BUFFER_INIT_SIZE];
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  public RowSectionWriter getRowWriter() {
    return rowWriter;
  }

  public ByteRange getValueByteRange() {
    return new ByteRange(values, 0, totalValueBytes);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  /*********************** construct *****************************/

  public TokenizerNode(Tokenizer builder, TokenizerNode parent, int nodeDepth,
      int tokenStartOffset, int tokenOffset, int tokenLength) {
    this.token = new ByteRange();
    reconstruct(builder, parent, nodeDepth, tokenStartOffset, tokenOffset, tokenLength);
    this.children = Lists.newArrayList();
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

    if (allocator == null) {
      return kv;
    }

    int len = kv.getLength();
    ByteRange alloc = allocator.allocateBytes(len);
    if (alloc == null) {
      // The allocation was too large, allocator decided
      // not to do anything with it.
      return kv;
    }
    assert alloc.getBytes() != null;
    alloc.put(0, kv.getBuffer(), kv.getOffset(), len);
    KeyValue newKv = new KeyValue(alloc.getBytes(), alloc.getOffset(), len);
    newKv.setSequenceId(kv.getMvccVersion());
    return newKv;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.util.ByteRange

  public TestColumnDataRandom(int numColumns) {
    RedundantKVGenerator generator = new RedundantKVGenerator();
    ByteRangeSet sortedColumns = new ByteRangeTreeSet();
    List<KeyValue> d = generator.generateTestKeyValues(numColumns);
    for (KeyValue col : d) {
      ByteRange colRange = new SimpleMutableByteRange(col.getQualifier());
      inputs.add(colRange);
      sortedColumns.add(colRange);
    }
    for (ByteRange col : sortedColumns.compile().getSortedRanges()) {
      outputs.add(col);
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.