Use TopicPartitionId as primary partition identity across all internal code#18949
Draft
rseetham wants to merge 3 commits into
Draft
Use TopicPartitionId as primary partition identity across all internal code#18949rseetham wants to merge 3 commits into
rseetham wants to merge 3 commits into
Conversation
…entity (Part 1 of multi-topic segment naming) This is part 1 of the multi-topic segment name format work. It introduces TopicPartitionId as a composite key holding topicId and partitionId, and adds getTopicPartitionId() to LLCSegmentName returning it. The original getPartitionGroupId() returning int is preserved as deprecated for binary compatibility during rolling upgrades. All call sites are migrated to use getTopicPartitionId().getPartitionId().
…l code Add context-aware LLCSegmentName(String, boolean hasMultipleStreams) that decomposes old-format composite partition IDs (e.g. 10003 -> topic 1, partition 3) at parse time when the table has multiple streams. This ensures TopicPartitionId is always canonical regardless of segment format. Migrate all internal maps from Map<Integer, ...> to Map<TopicPartitionId, ...> across controller, server, query planner, segment-local, and minion tasks. Change assignConsumingSegment, computeStartOffset, and other internal methods to accept TopicPartitionId directly. Thread hasMultipleStreams through RealtimeSegmentConfig, MutableIndexContext, and Lucene index constructors. Add TopicPartitionId.fromPartitionGroupMetadata() for SPI boundary wrapping and SegmentUtils.getTopicPartitionIdFromSegmentName() as the new API. Deprecate IngestionConfigUtils encode/decode helpers.
# Conflicts: # pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18949 +/- ##
==========================================
Coverage 64.92% 64.92%
Complexity 1347 1347
==========================================
Files 3395 3396 +1
Lines 212564 212682 +118
Branches 33518 33532 +14
==========================================
+ Hits 137998 138087 +89
- Misses 63424 63456 +32
+ Partials 11142 11139 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #18913 (
TopicPartitionIdintroduction) — please review/merge that one first.Note: this PR's commit list will show 2 commits (the #18913 commit plus this PR's own commit) because GitHub doesn't support basing a PR on another fork's branch — the diff is against
masteruntil #18913 merges. Once #18913 merges, this PR's diff/commit list will automatically shrink to just this PR's own commit (Use TopicPartitionId as primary partition identity...).TopicPartitionId.javais only created once, in #18913's commit; it is not duplicated.This PR migrates internal partition-identity handling from raw
int/Integerpartition IDs to theTopicPartitionIdcomposite key introduced in the prior PR, in preparation for supporting multiple Kafka topics per Pinot table.LLCSegmentName(String, boolean hasMultipleStreams)that decomposes old-format composite partition IDs (e.g.10003-> topic 1, partition 3) at parse time when the table has multiple streams, soTopicPartitionIdis always canonical regardless of segment format.Map<Integer, ...>toMap<TopicPartitionId, ...>across controller, server, query planner, segment-local, and minion tasks.assignConsumingSegment,computeStartOffset, and other internal methods to acceptTopicPartitionIddirectly instead of raw partition ints.hasMultipleStreamsthroughRealtimeSegmentConfig,MutableIndexContext, and Lucene index constructors.TopicPartitionId.fromPartitionGroupMetadata()for SPI boundary wrapping andSegmentUtils.getTopicPartitionIdFromSegmentName()as the new API.IngestionConfigUtilsencode/decode helpers (kept for external/legacy call sites not covered by this migration).