Ejemplo n.º 1
0
  protected boolean skipKVsNewerThanReadpoint() throws IOException {
    long readPoint = MultiVersionConsistencyControl.getThreadReadPoint();

    // We want to ignore all key-values that are newer than our current
    // readPoint
    while (enforceMVCC && cur != null && (cur.getMemstoreTS() > readPoint)) {
      hfs.next();
      cur = hfs.getKeyValue();
    }

    if (cur == null) {
      close();
      return false;
    }

    // For the optimisation in HBASE-4346, we set the KV's memstoreTS to
    // 0, if it is older than all the scanners' read points. It is possible
    // that a newer KV's memstoreTS was reset to 0. But, there is an
    // older KV which was not reset to 0 (because it was
    // not old enough during flush). Make sure that we set it correctly now,
    // so that the comparision order does not change.
    if (cur.getMemstoreTS() <= readPoint) {
      cur.setMemstoreTS(0);
    }
    return true;
  }
Ejemplo n.º 2
0
  public boolean reseek(KeyValue key) throws IOException {
    seekCount.incrementAndGet();

    try {
      try {
        if (!reseekAtOrAfter(hfs, key)) {
          close();
          return false;
        }
        cur = hfs.getKeyValue();

        return skipKVsNewerThanReadpoint();
      } finally {
        realSeekDone = true;
      }
    } catch (IOException ioe) {
      throw new IOException("Could not reseek " + this + " to key " + key, ioe);
    }
  }