odps-sdk-impl/odps-mapred-bridge/src/main/java/com/aliyun/odps/mapred/bridge/GroupingRecordIterator.java [57:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public boolean hasNext() {
    if (prefetch != null) {
      // If prefetched, it must has been compared, return compare result
      // immediately.
      return hasNext;
    } else {
      prefetch = queue.poll();
    }
    if (prefetch == null
        || keyGroupingComparator.compare(key.toWritableArray(), prefetch) != 0) {
      hasNext = false;
    } else {
      hasNext = true;
      fillKeyValue(prefetch);
    }
    return hasNext;
  }

  public boolean reset() {
    if (prefetch != null) {
      hasNext = true;
      fillKeyValue(prefetch);
      return true;
    }
    return false;
  }

  @Override
  public Record next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    prefetch = null;
    return value;
  }

  @Override
  public void remove() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    prefetch = null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



odps-sdk-impl/odps-mapred-local/src/main/java/com/aliyun/odps/mapred/local/LocalGroupingRecordIterator.java [70:112]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  @Override
  public boolean hasNext() {
    if (prefetch != null) {
      // If prefetched, it must has been compared, return compare result
      // immediately.
      return hasNext;
    } else {
      prefetch = queue.poll();
    }
    if (prefetch == null
        || keyGroupingComparator.compare(key.toWritableArray(), prefetch) != 0) {
      hasNext = false;
    } else {
      hasNext = true;
      fillKeyValue(prefetch);
    }
    return hasNext;
  }

  public boolean reset() {
    if (prefetch != null) {
      hasNext = true;
      fillKeyValue(prefetch);
      return true;
    }
    return false;
  }

  @Override
  public Record next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    prefetch = null;
    return value;
  }

  @Override
  public void remove() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    prefetch = null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



