Package org.apache.hadoop.hbase.util

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


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

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


  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

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

  }

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

  /**
   * Increment the row bytes and clear the other fields
   */
  public static KeyValue createFirstKeyInIncrementedRow(final Cell in){
    byte[] thisRow = new SimpleMutableByteRange(in.getRowArray(), in.getRowOffset(),
        in.getRowLength()).deepCopyToNewArray();
    byte[] nextRow = Bytes.unsignedCopyAndIncrement(thisRow);
    return createFirstOnRow(nextRow);
  }
View Full Code Here

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

  public PrefixTreeEncoder(OutputStream outputStream, boolean includeMvccVersion) {
    // used during cell accumulation
    this.blockMeta = new PrefixTreeBlockMeta();
    this.rowRange = new SimpleMutableByteRange();
    this.familyRange = new SimpleMutableByteRange();
    this.qualifierRange = new SimpleMutableByteRange();
    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

    maxValueLength = 0;
    totalBytes = 0;
  }

  protected void initializeTagHelpers() {
    this.tagsRange = new SimpleMutableByteRange();
    this.tagsDeduplicator = USE_HASH_COLUMN_SORTER ? new ByteRangeHashSet()
    : new ByteRangeTreeSet();
    this.tagsTokenizer = new Tokenizer();
    this.tagsWriter = new ColumnSectionWriter();
  }
View Full Code Here

  public RowSectionWriter getRowWriter() {
    return rowWriter;
  }

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

  }

  protected int store(ByteRange bytes) {
    int indexOfNewElement = numUniqueRanges;
    if (uniqueRanges.size() <= numUniqueRanges) {
      uniqueRanges.add(new SimpleMutableByteRange());
    }
    ByteRange storedRange = uniqueRanges.get(numUniqueRanges);
    int neededBytes = numBytes + bytes.getLength();
    byteAppender = ArrayUtils.growIfNecessary(byteAppender, neededBytes, 2 * neededBytes);
    bytes.deepCopyTo(byteAppender, numBytes);
View Full Code Here

    return fanOut;
  }

  public byte[] getToken() {
    // TODO pass in reusable ByteRange
    return new SimpleMutableByteRange(block, tokenOffset, tokenLength).deepCopyToNewArray();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.SimpleMutableByteRange

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.