Skip to content

Commit

Permalink
table_resolver refactor - introduce patternSplitter, decisionMerger (#…
Browse files Browse the repository at this point in the history
…925)

This PR changes the way patterns (wildcards such as `logs*`) are handled
by `table_resolver`.

Previously, many `table_resolver` rules had two code paths - one code
path for a single index (e.g. `logs1`) and one code path for patterns
(e.g. `logs1,logs2` or `logs*`), making those rules more complicated.
Moreover, one rule `makeCheckIfPatternMatchesAllConnectors` was the
primary one to handle patterns and it contained fragments of other
rules.

This PR introduces `patternSplitter`, `decisionMerger`. The
`table_resolver` now works like this:
1. `patternSplitter` splits a pattern (e.g. `logs*`) into concrete
single indexes (e.g. `logs1`, `logs2`)
2. Existing rules are evaluated on each single index separately
3. `decisionMerger` merges decisions of single indexes, making sure that
the decisions are compatible. It yields a single decision.
  • Loading branch information
avelanarius authored Nov 7, 2024
1 parent 3835d60 commit 2014c3c
Show file tree
Hide file tree
Showing 3 changed files with 276 additions and 255 deletions.
Loading

0 comments on commit 2014c3c

Please sign in to comment.