PDavid commented on code in PR #6361: URL: https://github.com/apache/hbase/pull/6361#discussion_r1822259750
########## hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java: ########## @@ -43,18 +43,25 @@ public class PrefixFilter extends FilterBase implements HintingFilter { protected boolean filterRow = true; protected boolean provideHint = false; protected Cell reversedNextCellHint; + protected Cell forwardNextCellHint; public PrefixFilter(final byte[] prefix) { this.prefix = prefix; - // Pre-compute reverse hint at creation to avoid re-computing it several times in the corner + // Pre-compute hints at creation to avoid re-computing them several times in the corner // case where there are a lot of cells between the hint and the first real match. - this.reversedNextCellHint = createReversedNextCellHint(); + createCellHints(); } - private Cell createReversedNextCellHint() { + private void createCellHints() { + if (prefix == null) { + return; + } // On reversed scan hint should be the prefix with last byte incremented byte[] reversedHintBytes = increaseLastNonMaxByte(this.prefix); - return PrivateCellUtil.createFirstOnRow(reversedHintBytes, 0, (short) reversedHintBytes.length); + this.reversedNextCellHint = Review Comment: Exactly. The direction can be influenced with `setReversed()` which can be invoked only after the filter creation. So it is available but can be changed after creation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org