Use TopicPartitionId as primary partition identity across all internal code#18948
Closed
rseetham wants to merge 2 commits into
Closed
Use TopicPartitionId as primary partition identity across all internal code#18948rseetham wants to merge 2 commits into
rseetham wants to merge 2 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.
Contributor
Author
|
Closing to recreate with correct base branch (was diffing against master instead of the stacked PR1 branch, causing PR1's commit to appear duplicated here). |
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. This PR migrates internal partition-identity handling from rawint/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).Test plan
test-compileacrosspinot-spi, pinot-common, pinot-controller, pinot-core, pinot-segment-local, pinot-query-plannerpasses cleanlyPinotLLCRealtimeSegmentManagerTest— 42/42 passIngestionDelayTrackerTest— 9/9 passPinotSegmentRestletResourceTest— 8/8 pass