Examples of seekTo()


Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

    assertTrue(storeFileInfo.isLink());

    // Now confirm that I can read from the link
    int count = 1;
    HFileScanner s = hsf.createReader().getScanner(false, false);
    s.seekTo();
    while (s.next()) {
      count++;
    }
    assertEquals((LAST_CHAR - FIRST_CHAR + 1) * (LAST_CHAR - FIRST_CHAR + 1), count);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

        BloomType.NONE, NoOpDataBlockEncoder.INSTANCE);

    // Now confirm that I can read from the ref to link
    int count = 1;
    HFileScanner s = hsfA.createReader().getScanner(false, false);
    s.seekTo();
    while (s.next()) {
      count++;
    }
    assertTrue(count > 0); // read some rows here
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

    StoreFile hsfB = new StoreFile(this.fs, pathB, testConf, cacheConf,
        BloomType.NONE, NoOpDataBlockEncoder.INSTANCE);

    // Now confirm that I can read from the ref to link
    HFileScanner sB = hsfB.createReader().getScanner(false, false);
    sB.seekTo();
   
    //count++ as seekTo() will advance the scanner
    count++;
    while (sB.next()) {
      count++;
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

      // Test bottom half first.
      // Now test reading from the top.
      boolean first = true;
      ByteBuffer key = null;
      HFileScanner topScanner = top.getScanner(false, false);
      while ((!topScanner.isSeeked() && topScanner.seekTo()) ||
             (topScanner.isSeeked() && topScanner.next())) {
        key = topScanner.getKey();

        if (topScanner.getReader().getComparator().compareFlatKey(key.array(),
          key.arrayOffset(), key.limit(), midkey, 0, midkey.length) < 0) {
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

      }
      LOG.info("Last in top: " + Bytes.toString(Bytes.toBytes(key)));

      first = true;
      HFileScanner bottomScanner = bottom.getScanner(false, false);
      while ((!bottomScanner.isSeeked() && bottomScanner.seekTo()) ||
          bottomScanner.next()) {
        previous = bottomScanner.getKey();
        key = bottomScanner.getKey();
        if (first) {
          first = false;
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

      assertNull(topPath);
      bottom = new StoreFile(this.fs, bottomPath, conf, cacheConf, BloomType.NONE,
          NoOpDataBlockEncoder.INSTANCE).createReader();
      first = true;
      bottomScanner = bottom.getScanner(false, false);
      while ((!bottomScanner.isSeeked() && bottomScanner.seekTo()) ||
          bottomScanner.next()) {
        key = bottomScanner.getKey();
        if (first) {
          first = false;
          keyKV = KeyValue.createKeyValueFromKey(key);
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

  @Override
  public byte[] getFirstKey() {
    if (!firstKeySeeked) {
      HFileScanner scanner = getScanner(true, true, false);
      try {
        if (scanner.seekTo()) {
          this.firstKey = Bytes.toBytes(scanner.getKey());
        }
        firstKeySeeked = true;
      } catch (IOException e) {
        LOG.warn("Failed seekTo first KV in the file", e);
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

    store.passSchemaMetricsTo(sf);
    HFileReaderV2 reader = (HFileReaderV2) sf.createReader().getHFileReader();
    try {
      // Open a scanner with (on read) caching disabled
      HFileScanner scanner = reader.getScanner(false, false);
      assertTrue(testDescription, scanner.seekTo());
      // Cribbed from io.hfile.TestCacheOnWrite
      long offset = 0;
      HFileBlock prevBlock = null;
      while (offset < reader.getTrailer().getLoadOnOpenDataOffset()) {
        long onDiskSize = -1;
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

    @Override
    void doRow(int i) throws Exception {
      HFileScanner scanner = this.reader.getScanner(false, true);
      byte [] b = getRandomRow();
      scanner.seekTo(b);
      ByteBuffer k = scanner.getKey();
      PerformanceEvaluationCommons.assertKey(b, k);
      ByteBuffer v = scanner.getValue();
      PerformanceEvaluationCommons.assertValueSize(v.limit(), ROW_LENGTH);
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.io.hfile.HFileScanner.seekTo()

    @Override
    void doRow(int i) throws Exception {
      HFileScanner scanner = this.reader.getScanner(false, false);
      byte [] b = getRandomRow();
      if (scanner.seekTo(b) != 0) {
        System.out.println("Nonexistent row: " + new String(b));
        return;
      }
      ByteBuffer k = scanner.getKey();
      PerformanceEvaluationCommons.assertKey(b, k);
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.