private MatchCode checkVersion(byte type, long timestamp) {
    if (!PrivateCellUtil.isDelete(type)) {
      currentCount++;
    }
    if (currentCount > maxVersions) {
      return ScanQueryMatcher.MatchCode.SEEK_NEXT_COL; // skip to next col
    }
    // keep the KV if required by minversions or it is not expired, yet
    if (currentCount <= minVersions || !isExpired(timestamp)) {
      setTSAndType(timestamp, type);
      return ScanQueryMatcher.MatchCode.INCLUDE;
    } else {
      return MatchCode.SEEK_NEXT_COL;
    }
  }
Check whether this version should be retained. There are 4 variables considered: If this
version is past max versions -> skip it If this kv has expired or was deleted, check min
versions to decide whther to skip it or not. Increase the version counter unless this is a
delete
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/ScanWildcardColumnTracker.java