SteveYurongSu opened a new pull request, #15975:
URL: https://github.com/apache/iotdb/pull/15975
This pull request introduces changes to enhance the event matching and
assignment process in the IoTDB pipeline system. The key updates include
modifying the `PipeDataRegionMatcher` interface to return both matched and
unmatched extractors, updating the `PipeDataRegionAssigner` class to handle
unmatched extractors, and refactoring the `CachedSchemaPatternMatcher` class to
support this new functionality.
### Enhancements to event matching and assignment:
* **Refactored `PipeDataRegionMatcher` interface**:
- Updated the `match` method to return a `Pair` containing both matched
and unmatched extractors, allowing for more granular handling of events.
(`[iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/realtime/matcher/PipeDataRegionMatcher.javaL46-R54](diffhunk://#diff-5b5220f1b93f7d32cd943edeacac90d1e2fc6784726c1660537d59565d3f049dL46-R54)`)
* **Updated `PipeDataRegionAssigner` class**:
- Enhanced the `assignToExtractor` method to process unmatched extractors
by generating and extracting `ProgressReportEvent` for specific event types
(`TabletInsertionEvent` and `TsFileInsertionEvent`).
(`[[1]](diffhunk://#diff-ebf1cdab6e5122f3d5189186be98d118d6df1c63942ca502754559839602f514L142-R150)`,
`[[2]](diffhunk://#diff-ebf1cdab6e5122f3d5189186be98d118d6df1c63942ca502754559839602f514R235-R267)`)
### Refactoring for improved functionality:
* **Refactored `CachedSchemaPatternMatcher` class**:
- Modified the `match` method to return a `Pair` of matched and unmatched
extractors.
- Added a new private method `findUnmatchedExtractors` to identify
unmatched extractors.
(`[[1]](diffhunk://#diff-4154e5d93849dca5f34ea041d789008d7af056e09916390635eb6f3d963843a4L129-R150)`,
`[[2]](diffhunk://#diff-4154e5d93849dca5f34ea041d789008d7af056e09916390635eb6f3d963843a4R176-R191)`)
### Test updates:
* **Updated unit tests**:
- Adjusted test cases in `CachedSchemaPatternMatcherTest` to use the
`getLeft` method on the `Pair` returned by `match`, ensuring proper validation
of matched extractors.
(`[iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/CachedSchemaPatternMatcherTest.javaL168-R173](diffhunk://#diff-cc7ffe8a75f8814d500ca9a113d3e31306f32603711d4019711dfeefa34052e2L168-R173)`)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]