Package org.apache.hadoop.hbase.io.hfile

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


      }

      if (verifyBulkLoads) {
        KeyValue prevKV = null;
        HFileScanner scanner = reader.getScanner(false, false, false);
        scanner.seekTo();
        do {
          KeyValue kv = scanner.getKeyValue();
          if (prevKV != null) {
            if (Bytes.compareTo(prevKV.getBuffer(), prevKV.getRowOffset(),
                prevKV.getRowLength(), kv.getBuffer(), kv.getRowOffset(),
View Full Code Here


    @Override
    void doRow(int i) throws Exception {
      HFileScanner scanner = this.reader.getScanner();
      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

    @Override
    void doRow(int i) throws Exception {
      HFileScanner scanner = this.reader.getScanner();
      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

    }

    @Override
    void doRow(int i) throws Exception {
      HFileScanner scanner = this.reader.getScanner();
      scanner.seekTo(getGaussianRandomRowBytes());
      for (int ii = 0; ii < 30; ii++) {
        if (!scanner.next()) {
          System.out.println("NOTHING FOLLOWS");
        }
        scanner.getKey();
View Full Code Here

    int count = 0;
    boolean containsStartRow = false;
    for (StoreFile f: this.r.stores.get(COLUMN_FAMILY_TEXT).getStorefiles().
        values()) {
      HFileScanner scanner = f.getReader().getScanner(false);
      scanner.seekTo();
      do {
        byte [] row = scanner.getKeyValue().getRow();
        if (Bytes.equals(row, STARTROW)) {
          containsStartRow = true;
          count++;
View Full Code Here

  private int count() throws IOException {
    int count = 0;
    for (StoreFile f: this.r.stores.
        get(COLUMN_FAMILY_TEXT).getStorefiles().values()) {
      HFileScanner scanner = f.getReader().getScanner();
      if (!scanner.seekTo()) {
        continue;
      }
      do {
        count++;
      } while(scanner.next());
View Full Code Here

    Path refPath = StoreFile.split(fs, dir, hsf, reader.midkey(), Range.top);
    StoreFile refHsf = new StoreFile(this.fs, refPath, true, conf, false);
    // Now confirm that I can read from the reference and that it only gets
    // keys from top half of the file.
    HFileScanner s = refHsf.getReader().getScanner();
    for(boolean first = true; (!s.isSeeked() && s.seekTo()) || s.next();) {
      ByteBuffer bb = s.getKey();
      hsk = HStoreKey.create(bb.array(), bb.arrayOffset(), bb.limit());
      if (first) {
        assertTrue(Bytes.equals(hsk.getRow(), midkey));
        first = false;
View Full Code Here

      // Test bottom half first.
      // Now test reading from the top.
      boolean first = true;
      ByteBuffer key = null;
      HFileScanner topScanner = top.getScanner();
      while ((!topScanner.isSeeked() && topScanner.seekTo()) ||
          (topScanner.isSeeked() && topScanner.next())) {
        key = topScanner.getKey();
       
        assertTrue(topScanner.getReader().getComparator().compare(key.array(),
          key.arrayOffset(), key.limit(), midkeyBytes, 0, midkeyBytes.length) >= 0);
View Full Code Here

      }
      LOG.info("Last in top: " + Bytes.toString(Bytes.toBytes(key)));
     
      first = true;
      HFileScanner bottomScanner = bottom.getScanner();
      while ((!bottomScanner.isSeeked() && bottomScanner.seekTo()) ||
          bottomScanner.next()) {
        previous = bottomScanner.getKey();
        key = bottomScanner.getKey();
        if (first) {
          first = false;
View Full Code Here

        Range.bottom);
      top = new StoreFile(this.fs, topPath, true, conf, false).getReader();
      bottom = new StoreFile(this.fs, bottomPath, true, conf, false).getReader();
      bottomScanner = bottom.getScanner();
      int count = 0;
      while ((!bottomScanner.isSeeked() && bottomScanner.seekTo()) ||
          bottomScanner.next()) {
        count++;
      }
      // When badkey is < than the bottom, should return no values.
      assertTrue(count == 0);
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.