@Override
  public boolean hasNext() {
    if (kvsIterator == null) { // for the case when the result is empty
      return false;
    }
    // return true either we have cells in buffer or we can get more.
    return kvsIterator.hasNext() || refillKVS();
  }
The MemStoreCompactorSegmentsIterator extends MemStoreSegmentsIterator and performs the scan for
compaction operation meaning it is based on SQM
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactorSegmentsIterator.java