Package org.apache.hadoop.hbase.codec.prefixtree

Examples of org.apache.hadoop.hbase.codec.prefixtree.PrefixTreeBlockMeta


  /***************** 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];
View Full Code Here


    blockMetaWriter = encoder.getBlockMeta();
    outputBytes = os.toByteArray();

    // start reading, but save the assertions for @Test methods
    buffer = ByteBuffer.wrap(outputBytes);
    blockMetaReader = new PrefixTreeBlockMeta(buffer);

    searcher = new PrefixTreeArraySearcher(blockMetaReader, blockMetaReader.getRowTreeDepth(),
        blockMetaReader.getMaxRowLength(), blockMetaReader.getMaxQualifierLength(),
        blockMetaReader.getMaxTagsLength());
    searcher.initOnBlock(blockMetaReader, outputBytes, includeMemstoreTS);
View Full Code Here

    List<ByteRange> inputs = columns.getInputs();
    this.columnSorter = new ByteRangeTreeSet(inputs);
    this.sortedUniqueColumns = columnSorter.compile().getSortedRanges();
    List<byte[]> copies = ByteRangeUtils.copyToNewArrays(sortedUniqueColumns);
    Assert.assertTrue(Bytes.isSorted(copies));
    this.blockMeta = new PrefixTreeBlockMeta();
    this.blockMeta.setNumMetaBytes(0);
    this.blockMeta.setNumRowBytes(0);
    this.builder = new Tokenizer();
  }
View Full Code Here

  private byte[] bytes;
  private TimestampDecoder decoder;

  public TestTimestampEncoder(TestTimestampData testTimestamps) throws IOException {
    this.timestamps = testTimestamps;
    this.blockMeta = new PrefixTreeBlockMeta();
    this.blockMeta.setNumMetaBytes(0);
    this.blockMeta.setNumRowBytes(0);
    this.blockMeta.setNumQualifierBytes(0);
    this.encoder = new LongEncoder();
    for (Long ts : testTimestamps.getInputs()) {
View Full Code Here

public class TestBlockMeta {

  static int BLOCK_START = 123;

  private static PrefixTreeBlockMeta createSample() {
    PrefixTreeBlockMeta m = new PrefixTreeBlockMeta();
    m.setNumMetaBytes(0);
    m.setNumKeyValueBytes(3195);

    m.setNumRowBytes(0);
    m.setNumFamilyBytes(3);
    m.setNumQualifierBytes(12345);
    m.setNumTagsBytes(50);
    m.setNumTimestampBytes(23456);
    m.setNumMvccVersionBytes(5);
    m.setNumValueBytes(34567);

    m.setNextNodeOffsetWidth(3);
    m.setFamilyOffsetWidth(1);
    m.setQualifierOffsetWidth(2);
    m.setTagsOffsetWidth(2);
    m.setTimestampIndexWidth(1);
    m.setMvccVersionIndexWidth(2);
    m.setValueOffsetWidth(8);
    m.setValueLengthWidth(3);

    m.setRowTreeDepth(11);
    m.setMaxRowLength(200);
    m.setMaxQualifierLength(50);
    m.setMaxTagsLength(40);

    m.setMinTimestamp(1318966363481L);
    m.setTimestampDeltaWidth(3);
    m.setMinMvccVersion(100L);
    m.setMvccVersionDeltaWidth(4);

    m.setAllSameType(false);
    m.setAllTypes(KeyValue.Type.Delete.getCode());

    m.setNumUniqueRows(88);
    m.setNumUniqueFamilies(1);
    m.setNumUniqueQualifiers(56);
    m.setNumUniqueTags(5);
    return m;
  }
View Full Code Here

  private byte[] bytes;
  private TimestampDecoder decoder;

  public TestTimestampEncoder(TestTimestampData testTimestamps) throws IOException {
    this.timestamps = testTimestamps;
    this.blockMeta = new PrefixTreeBlockMeta();
    this.blockMeta.setNumMetaBytes(0);
    this.blockMeta.setNumRowBytes(0);
    this.blockMeta.setNumQualifierBytes(0);
    this.encoder = new LongEncoder();
    for (Long ts : testTimestamps.getInputs()) {
View Full Code Here

    blockMetaWriter = encoder.getBlockMeta();
    outputBytes = os.toByteArray();

    // start reading, but save the assertions for @Test methods
    buffer = ByteBuffer.wrap(outputBytes);
    blockMetaReader = new PrefixTreeBlockMeta(buffer);

    searcher = new PrefixTreeArraySearcher(blockMetaReader, blockMetaReader.getRowTreeDepth(),
        blockMetaReader.getMaxRowLength(), blockMetaReader.getMaxQualifierLength(),
        blockMetaReader.getMaxTagsLength());
    searcher.initOnBlock(blockMetaReader, outputBytes, includeMemstoreTS);
View Full Code Here

    List<ByteRange> inputs = columns.getInputs();
    this.columnSorter = new ByteRangeTreeSet(inputs);
    this.sortedUniqueColumns = columnSorter.compile().getSortedRanges();
    List<byte[]> copies = ByteRangeUtils.copyToNewArrays(sortedUniqueColumns);
    Assert.assertTrue(Bytes.isSorted(copies));
    this.blockMeta = new PrefixTreeBlockMeta();
    this.blockMeta.setNumMetaBytes(0);
    this.blockMeta.setNumRowBytes(0);
    this.builder = new Tokenizer();
  }
View Full Code Here

public class TestBlockMeta {

  static int BLOCK_START = 123;

  private static PrefixTreeBlockMeta createSample() {
    PrefixTreeBlockMeta m = new PrefixTreeBlockMeta();
    m.setNumMetaBytes(0);
    m.setNumKeyValueBytes(3195);

    m.setNumRowBytes(0);
    m.setNumFamilyBytes(3);
    m.setNumQualifierBytes(12345);
    m.setNumTagsBytes(50);
    m.setNumTimestampBytes(23456);
    m.setNumMvccVersionBytes(5);
    m.setNumValueBytes(34567);

    m.setNextNodeOffsetWidth(3);
    m.setFamilyOffsetWidth(1);
    m.setQualifierOffsetWidth(2);
    m.setTagsOffsetWidth(2);
    m.setTimestampIndexWidth(1);
    m.setMvccVersionIndexWidth(2);
    m.setValueOffsetWidth(8);
    m.setValueLengthWidth(3);

    m.setRowTreeDepth(11);
    m.setMaxRowLength(200);
    m.setMaxQualifierLength(50);
    m.setMaxTagsLength(40);

    m.setMinTimestamp(1318966363481L);
    m.setTimestampDeltaWidth(3);
    m.setMinMvccVersion(100L);
    m.setMvccVersionDeltaWidth(4);

    m.setAllSameType(false);
    m.setAllTypes(KeyValue.Type.Delete.getCode());

    m.setNumUniqueRows(88);
    m.setNumUniqueFamilies(1);
    m.setNumUniqueQualifiers(56);
    m.setNumUniqueTags(5);
    return m;
  }
View Full Code Here

    return m;
  }

  @Test
  public void testStreamSerialization() throws IOException {
    PrefixTreeBlockMeta original = createSample();
    ByteArrayOutputStream os = new ByteArrayOutputStream(10000);
    original.writeVariableBytesToOutputStream(os);
    ByteBuffer buffer = ByteBuffer.wrap(os.toByteArray());
    PrefixTreeBlockMeta roundTripped = new PrefixTreeBlockMeta(buffer);
    Assert.assertTrue(original.equals(roundTripped));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.codec.prefixtree.PrefixTreeBlockMeta

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.