Skip to content

HBASE-30150 Propagate filter hints through composite filters#8239

Merged
virajjasani merged 5 commits into
apache:branch-2.6from
shubham-roy:branch-2.6-HBASE-30150
May 16, 2026
Merged

HBASE-30150 Propagate filter hints through composite filters#8239
virajjasani merged 5 commits into
apache:branch-2.6from
shubham-roy:branch-2.6-HBASE-30150

Conversation

@shubham-roy
Copy link
Copy Markdown
Contributor

Original PR: #8217

Shubham Roy and others added 5 commits May 15, 2026 09:34
…ite filters

FilterList (AND/OR), SkipFilter, and WhileMatchFilter now delegate
getHintForRejectedRow() and getSkipHint() to their sub-filters, using
maximal-step merging for AND and minimal-step merging for OR — consistent
with the existing getNextCellHint() convention. ColumnRangeFilter and
ColumnPrefixFilter gain stateless getSkipHint() implementations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nd strengthen test coverage

- Add getSkipHint() to MultipleColumnPrefixFilter so it participates in
  the structural-skip hint optimization alongside ColumnPrefixFilter and
  ColumnRangeFilter.
- Add unit tests for the all-sub-filters-terminated edge case in both
  AND and OR FilterList for getHintForRejectedRow and getSkipHint.
- Add integration test for MultipleColumnPrefixFilter.getSkipHint with
  time-range gating.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…HintForRejectedRow

- Track which sub-filters actually rejected via filterRowKey() using a
  boolean[] rejectedByFilterRowKey array (mirrors seekHintFilters pattern).
  getHintForRejectedRow now only consults sub-filters that individually
  returned true from filterRowKey, honouring the per-filter contract.
- Clarify Filter.java javadoc: OR's null-collapse semantic is now
  explicitly documented for both getHintForRejectedRow and getSkipHint.
- Add unit test proving the contract: a non-rejecting sub-filter that
  throws IllegalStateException from getHintForRejectedRow is never called.
- Add divergent-hint tests (unit + integration) asserting AND correctly
  returns max when sub-filters hint to different targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Preserve existing rejection state in addFilterLists via Arrays.copyOf
  instead of clobbering with a fresh zero array.
- Add javadoc on rejectedByFilterRowKey field documenting the reset
  invariant (cleared only by reset(), callers must invoke between rows).
- Update Filter.getHintForRejectedRow javadoc to make AND's per-sub-filter
  gating visible to filter authors.
- Add reset-invariant unit test: reject row1 -> reset -> accept row2 ->
  assert getHintForRejectedRow returns null (no stale state).
- Clarify fixedRejectedRowHintFilter vs rejectingRowHintFilter helper
  comments for future contributors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…epth

- Fix 4 getSkipHint integration tests to compare hint-aware scan against
  a genuine no-hint baseline (FilterBase wrapper that delegates filterCell
  but does not override getSkipHint), ensuring the tests would catch a
  wrong hint that loses data.
- Fix testWhileMatchFilterHintDelegation: assert hintCalls==0 since
  WhileMatchFilter sets filterAllRemaining before getHintForRejectedRow
  is consulted by the scanner — documenting the short-circuit behavior.
- Add Arrays.fill(rejectedByFilterRowKey, false) at the start of
  filterRowKey() as defense-in-depth against callers that skip reset().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@virajjasani virajjasani merged commit 62bab51 into apache:branch-2.6 May 16, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants