@Override
  public boolean filterRowKey(Cell firstRowCell) {
    if (firstRowCell == null || this.prefix == null) {
      return true;
    }
    if (filterAllRemaining()) {
      return true;
    }
    // if the cell is before => return false so that getNextCellHint() is invoked.
    // if they are equal, return false => pass row
    // if the cell is after => return true, filter row
    // if we are passed the prefix, set flag
    int cmp;
    if (firstRowCell instanceof ByteBufferExtendedCell) {
      cmp = ByteBufferUtils.compareTo(((ByteBufferExtendedCell) firstRowCell).getRowByteBuffer(),
        ((ByteBufferExtendedCell) firstRowCell).getRowPosition(), this.prefix.length, this.prefix,
        0, this.prefix.length);
    } else {
      cmp = Bytes.compareTo(firstRowCell.getRowArray(), firstRowCell.getRowOffset(),
        this.prefix.length, this.prefix, 0, this.prefix.length);
    }
    if ((!isReversed() && cmp > 0) || (isReversed() && cmp < 0)) {
      passedPrefix = true;
    }
    filterRow = (cmp != 0);
    provideHint = (!isReversed() && cmp < 0) || (isReversed() && cmp > 0);
    return passedPrefix;
  }
Pass results that have same row prefix.
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java