Java 类org.apache.hadoop.hbase.codec.prefixtree.decode.PrefixTreeArraySearcher 实例源码

项目:ditb    文件:TestRowEncoder.java   
@Before
public void compile() throws IOException {
  // Always run with tags. But should also ensure that KVs without tags work fine
  os = new ByteArrayOutputStream(1 << 20);
  encoder = new PrefixTreeEncoder(os, includeMemstoreTS);

  inputKvs = rows.getInputs();
  for (KeyValue kv : inputKvs) {
    encoder.write(kv);
  }
  encoder.flush();
  totalBytes = encoder.getTotalBytes();
  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);
}
项目:pbase    文件:TestRowEncoder.java   
@Before
public void compile() throws IOException {
  // Always run with tags. But should also ensure that KVs without tags work fine
  os = new ByteArrayOutputStream(1 << 20);
  encoder = new PrefixTreeEncoder(os, includeMemstoreTS);

  inputKvs = rows.getInputs();
  for (KeyValue kv : inputKvs) {
    encoder.write(kv);
  }
  encoder.flush();
  totalBytes = encoder.getTotalBytes();
  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);
}
项目:HIndex    文件:TestRowEncoder.java   
@Before
public void compile() throws IOException {
  // Always run with tags. But should also ensure that KVs without tags work fine
  os = new ByteArrayOutputStream(1 << 20);
  encoder = new PrefixTreeEncoder(os, includeMemstoreTS);

  inputKvs = rows.getInputs();
  for (KeyValue kv : inputKvs) {
    encoder.write(kv);
  }
  encoder.flush();
  totalBytes = encoder.getTotalBytes();
  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);
}
项目:PyroDB    文件:TestRowEncoder.java   
@Before
public void compile() throws IOException {
  // Always run with tags. But should also ensure that KVs without tags work fine
  os = new ByteArrayOutputStream(1 << 20);
  encoder = new PrefixTreeEncoder(os, includeMemstoreTS);

  inputKvs = rows.getInputs();
  for (KeyValue kv : inputKvs) {
    encoder.write(kv);
  }
  encoder.flush();
  totalBytes = encoder.getTotalBytes();
  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);
}
项目:c5    文件:TestRowEncoder.java   
@Before
public void compile() throws IOException {
  os = new ByteArrayOutputStream(1 << 20);
  encoder = new PrefixTreeEncoder(os, includeMemstoreTS);

  inputKvs = rows.getInputs();
  for (KeyValue kv : inputKvs) {
    encoder.write(kv);
  }
  encoder.flush();
  totalBytes = encoder.getTotalBytes();
  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());
  searcher.initOnBlock(blockMetaReader, outputBytes, includeMemstoreTS);
}
项目:ditb    文件:PrefixTreeCodec.java   
@Override
public ByteBuffer getFirstKeyInBlock(ByteBuffer block) {
  block.rewind();
  PrefixTreeArraySearcher searcher = null;
  try {
    // should i includeMemstoreTS (second argument)?  i think PrefixKeyDeltaEncoder is, so i will
    searcher = DecoderFactory.checkOut(block, true);
    if (!searcher.positionAtFirstCell()) {
      return null;
    }
    return KeyValueUtil.copyKeyToNewByteBuffer(searcher.current());
  } finally {
    DecoderFactory.checkIn(searcher);
  }
}
项目:pbase    文件:PrefixTreeCodec.java   
@Override
public ByteBuffer getFirstKeyInBlock(ByteBuffer block) {
  block.rewind();
  PrefixTreeArraySearcher searcher = null;
  try {
    // should i includeMemstoreTS (second argument)?  i think PrefixKeyDeltaEncoder is, so i will
    searcher = DecoderFactory.checkOut(block, true);
    if (!searcher.positionAtFirstCell()) {
      return null;
    }
    return KeyValueUtil.copyKeyToNewByteBuffer(searcher.current());
  } finally {
    DecoderFactory.checkIn(searcher);
  }
}
项目:HIndex    文件:PrefixTreeCodec.java   
@Override
public ByteBuffer getFirstKeyInBlock(ByteBuffer block) {
  block.rewind();
  PrefixTreeArraySearcher searcher = null;
  try {
    // should i includeMemstoreTS (second argument)?  i think PrefixKeyDeltaEncoder is, so i will
    searcher = DecoderFactory.checkOut(block, true);
    if (!searcher.positionAtFirstCell()) {
      return null;
    }
    return KeyValueUtil.copyKeyToNewByteBuffer(searcher.current());
  } finally {
    DecoderFactory.checkIn(searcher);
  }
}
项目:PyroDB    文件:PrefixTreeCodec.java   
@Override
public ByteBuffer getFirstKeyInBlock(ByteBuffer block) {
  block.rewind();
  PrefixTreeArraySearcher searcher = null;
  try {
    // should i includeMemstoreTS (second argument)?  i think PrefixKeyDeltaEncoder is, so i will
    searcher = DecoderFactory.checkOut(block, true);
    if (!searcher.positionAtFirstCell()) {
      return null;
    }
    return KeyValueUtil.copyKeyToNewByteBuffer(searcher.current());
  } finally {
    DecoderFactory.checkIn(searcher);
  }
}
项目:c5    文件:PrefixTreeCodec.java   
@Override
public ByteBuffer getFirstKeyInBlock(ByteBuffer block) {
  block.rewind();
  PrefixTreeArraySearcher searcher = null;
  try {
    //should i includeMemstoreTS (second argument)?  i think PrefixKeyDeltaEncoder is, so i will
    searcher = DecoderFactory.checkOut(block, true);
    if (!searcher.positionAtFirstCell()) {
      return null;
    }
    return KeyValueUtil.copyKeyToNewByteBuffer(searcher.current());
  } finally {
    DecoderFactory.checkIn(searcher);
  }
}