public Scan setStartStopRowForPrefixScan(byte[] rowPrefix) {
    if (rowPrefix == null) {
      withStartRow(HConstants.EMPTY_START_ROW);
      withStopRow(HConstants.EMPTY_END_ROW);
    } else {
      this.withStartRow(rowPrefix);
      this.withStopRow(ClientUtil.calculateTheClosestNextRowKeyForPrefix(rowPrefix));
    }
    return this;
  }
<p>
Set a filter (using stopRow and startRow) so the result set only contains rows where the rowKey
starts with the specified prefix.
</p>
<p>
This is a utility method that converts the desired rowPrefix into the appropriate values for
the startRow and stopRow to achieve the desired result.
</p>
<p>
This can safely be used in combination with setFilter.
</p>
<p>
<strong>This CANNOT be used in combination with withStartRow and/or withStopRow.</strong> Such
a combination will yield unexpected and even undefined results.
</p>
@param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.)
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java