Skip to content

chore(base-query): clean up AbstractHeapBasedIndex#82

Merged
deer merged 1 commit into
mainfrom
index_cleanup
May 19, 2026
Merged

chore(base-query): clean up AbstractHeapBasedIndex#82
deer merged 1 commit into
mainfrom
index_cleanup

Conversation

@deer

@deer deer commented May 19, 2026

Copy link
Copy Markdown
Collaborator
  • Moves reflection out of the hot path: resolveFunction() now runs once at memoization time (via Memoizer) instead of re-resolving Field → Function inside every index(), unindex(), and reindexDynamic() call.
  • Splits the single dynamicIndexableFunctionFieldsByClass memoizer into dynamicNonUniqueFunctionsByClass and dynamicUniqueFunctionsByClass, consistent with how the static function memoizers are structured.
  • Extracts indexNonUnique, indexUnique, unindexNonUnique, unindexUnique, reindexNonUnique, and reindexUnique from the deeply-nested lambda bodies that previously lived inline in index(), unindex(), and reindexDynamic().
  • Adds pair-level primitives putNonUnique, removeNonUnique, putUnique, removeUnique and structural helpers onNonUniquePair, onUniquePair, onExistingNonUniquePair, onExistingUniquePair to encapsulate the ConcurrentHashMap outer/inner compute patterns.
  • Introduces AbstractTerminal to deduplicate the where/scope/scope() boilerplate that was verbatim across IsEqualTo, IsNotEqualTo, and Matches.
  • Moves matchingUniquePairs() and matchingIndexPairs() onto Where, removing the same 6-line stream chain repeated in each terminal's findAll().
  • Extracts isIndexableFunctionField, toIndexableValue, and isIndexParticipant utilities.

@deer deer merged commit cad2880 into main May 19, 2026
3 checks passed
@deer deer deleted the index_cleanup branch May 19, 2026 09:43
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.

1 participant