@Override
  public boolean filterRowKey(Cell firstRowCell) {
    if (filterAllRemaining()) return true;

    // N.b. We can only do this after we're iterating over records. If we try to do
    // it before, the Scan (and this filter) may not yet be fully initialized. This is a
    // wart on Filter and something that'd be nice to clean up (like CP's in HBase2.0)
    if (!ranges.isInitialized()) {
      ranges.initialize(isReversed());
    }

    // If it is the first time of running, calculate the current range index for
    // the row key. If index is out of bound which happens when the start row
    // user sets is after the largest stop row of the ranges, stop the scan.
    // If row key is after the current range, find the next range and update index.
    byte[] rowArr = firstRowCell.getRowArray();
    int length = firstRowCell.getRowLength();
    int offset = firstRowCell.getRowOffset();
    if (!ranges.hasFoundFirstRange() || !range.contains(rowArr, offset, length)) {
      byte[] rowkey = CellUtil.cloneRow(firstRowCell);
      index = ranges.getNextRangeIndex(rowkey);
      if (ranges.isIterationComplete(index)) {
        done = true;
        currentReturnCode = ReturnCode.NEXT_ROW;
        return false;
      }
      if (index != ROW_BEFORE_FIRST_RANGE) {
        range = ranges.get(index);
      } else {
        range = ranges.get(0);
      }
      if (ranges.isExclusive()) {
        ranges.resetExclusive();
        currentReturnCode = ReturnCode.NEXT_ROW;
        return false;
      }
      if (!ranges.hasFoundFirstRange()) {
        if (index != ROW_BEFORE_FIRST_RANGE) {
          currentReturnCode = ReturnCode.INCLUDE;
        } else {
          currentReturnCode = ReturnCode.SEEK_NEXT_USING_HINT;
        }
        ranges.setFoundFirstRange();
      } else {
        if (range.contains(rowArr, offset, length)) {
          currentReturnCode = ReturnCode.INCLUDE;
        } else {
          currentReturnCode = ReturnCode.SEEK_NEXT_USING_HINT;
        }
      }
    } else {
      currentReturnCode = ReturnCode.INCLUDE;
    }
    return false;
  }
Constructor for creating a <code>MultiRowRangeFilter</code> from multiple rowkey prefixes. As
<code>MultiRowRangeFilter</code> javadoc says (See the solution 1 of the first statement), if
you try to create a filter list that scans row keys corresponding to given prefixes (e.g.,
<code>FilterList</code> composed of multiple <code>PrefixFilter</code>s), this constructor
provides a way to avoid creating an inefficient one.
@param rowKeyPrefixes the array of byte array
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultiRowRangeFilter.java