diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java index 36b116bd90af..8aa3955a9c4b 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -383,6 +383,9 @@ public Scan withStartRow(byte[] startRow) { *

* 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. + *

+ * Note: When use {@link #setRowPrefixFilter(byte[])}, the result might be unexpected. + *

* @param startRow row to start scanner at or after * @param inclusive whether we should include the start row when scan * @return this @@ -447,7 +450,15 @@ public Scan withStopRow(byte[] stopRow, boolean inclusive) { * after this method will yield undefined results.

* @param rowPrefix the prefix all rows must start with. (Set null 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);