Skip to content

Commit

Permalink
HBASE-25299 Scan#setRowPrefixFilter Unexpected behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
tangtianhang committed Nov 18, 2020
1 parent 9419c78 commit c8fcfda
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -383,6 +383,9 @@ public Scan withStartRow(byte[] startRow) {
* <p>
* If the specified row does not exist, or the {@code inclusive} is {@code false}, the Scanner
* will start from the next closest row after the specified row.
* <p>
* <b>Note:</b> When use {@link #setRowPrefixFilter(byte[])}, the result might be unexpected.
* </p>
* @param startRow row to start scanner at or after
* @param inclusive whether we should include the start row when scan
* @return this
Expand Down Expand Up @@ -447,7 +450,15 @@ public Scan withStopRow(byte[] stopRow, boolean inclusive) {
* after this method will yield undefined results.</b></p>
* @param rowPrefix the prefix all rows must start with. (Set <i>null</i> to remove the filter.)
* @return this
* @deprecated since 3.0.0. The scan result might be unexpected in some cases.
* e.g. startRow : "112" and rowPrefixFilter : "11"
* The Result of this scan might contains : "111"
* This method implements the filter by setting startRow and stopRow,
* but does not take care of the scene where startRow has been set.
* Users can compose this logic externally through other methods,
* so there is no need to implement it inside.
*/
@Deprecated
public Scan setRowPrefixFilter(byte[] rowPrefix) {
if (rowPrefix == null) {
withStartRow(HConstants.EMPTY_START_ROW);
Expand Down

0 comments on commit c8fcfda

Please sign in to comment.