Move partial-upsert resolveComparisonTies method from base class to implementations#18640
Move partial-upsert resolveComparisonTies method from base class to implementations#18640deepthi912 wants to merge 2 commits into
Conversation
…lasses The base addOrReplaceSegment wrapper in BasePartitionUpsertMetadataManager existed only to call resolveComparisonTies for partial-upsert before delegating to the subclass-specific doAddOrReplaceSegment. This made the abstract doAddOrReplaceSegment signature redundant with its only caller. Inline the wrapper: callers now invoke doAddOrReplaceSegment directly, and the resolveComparisonTies call moves into ConcurrentMapPartitionUpsertMetadataManager and ConcurrentMapPartitionUpsertMetadataManagerForConsistentDeletes (the only two non-abstract subclasses). Removes one virtual call per segment add/replace and eliminates a layer of indirection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nager Line 661 was 121 chars; wrap argument list so each line stays ≤120. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18640 +/- ##
=========================================
Coverage 64.38% 64.39%
Complexity 1282 1282
=========================================
Files 3359 3359
Lines 207825 207824 -1
Branches 32447 32447
=========================================
+ Hits 133818 133825 +7
+ Misses 63244 63237 -7
+ Partials 10763 10762 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (_partialUpsertHandler != null) { | ||
| recordInfoIterator = resolveComparisonTies(recordInfoIterator, _hashFunction); | ||
| } |
There was a problem hiding this comment.
For this method resolveComparisonTies can we try to not construct the entire Map in-memory here just to get the iterator?
We have something similar in BasePartitionDedupMetadataManager#addOrReplaceSegment, and it's creating the iterator properly via some readers without allocating the memory all at once.
There was a problem hiding this comment.
Okay it seems we need to do a deduplication here on all records from recordInfoIterator, so a huge on-heap allocation is inevitable.
Remove the logic of comparison ties to implementations and remove unnecessary methods from the base class.