refactor LLRealtimeSegmentDataManager#9424
Conversation
|
@Jackie-Jiang / @KKcorps / @npawar : please review! |
.../src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/segment/local/realtime/converter/ColumnDescriptionsContainer.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pinot/core/data/manager/realtime/HLRealtimeSegmentDataManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Should we consider renaming the caller method name?
There was a problem hiding this comment.
I don't know why an interface called StreamMetadataProvider contains a method for both createStreamMetadataProvider (stream-level) and createPartitionMetadataProvider (partition-level). I am sure there some history to do this.
what is your proposal here?
There was a problem hiding this comment.
I don't know why an interface called StreamMetadataProvider contains a method for both createStreamMetadataProvider (stream-level) and createPartitionMetadataProvider (partition-level).
I think it's because the high-level segment data manager was implemented before the low-level segment data manager. But since the caller method is a private class, we can make it more intuitive to understand by just renaming it.
There was a problem hiding this comment.
Ok. I renamed the method to createPartitionMetadataProvider
There was a problem hiding this comment.
Sorry for the late comment here. Somehow I forgot to submit the review yesterday.
By taking a closer look, the purpose of _streamMetadataProvider is to fetch the latest value of partitionCount from the stream provider, which shouldn't associate with any particular partitionId here. We should stick to using the stream-level stream metadata provider here.
...main/java/org/apache/pinot/segment/local/realtime/converter/ColumnDescriptionsContainer.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/segment/local/realtime/converter/ColumnDescriptionsContainer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverter.java
Outdated
Show resolved
Hide resolved
6287306 to
ee02a56
Compare
Codecov Report
@@ Coverage Diff @@
## master #9424 +/- ##
============================================
+ Coverage 68.59% 69.90% +1.30%
- Complexity 4710 4744 +34
============================================
Files 1904 1910 +6
Lines 101661 101758 +97
Branches 15433 15440 +7
============================================
+ Hits 69735 71133 +1398
+ Misses 26924 25609 -1315
- Partials 5002 5016 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
.../src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
Outdated
Show resolved
Hide resolved
dd50f59 to
230eadd
Compare
230eadd to
8e3b13c
Compare
… partition and stream level
jackjlli
left a comment
There was a problem hiding this comment.
LGTM. Thanks for addressing all the comments!
| createPartitionMetadataProvider("Fetch latest stream offset"); | ||
| } | ||
| try { | ||
| return _partitionMetadataProvider.fetchStreamPartitionOffset(OffsetCriteria.LARGEST_OFFSET_CRITERIA, |
There was a problem hiding this comment.
+1 on this. No need to instantiate another partitionLevelMetadataProvider here.
* use only createPartitionMetadataProvider in LLRealtimeSegmentDataManager * Moving columns into a container class * remove from HLRealtimeSegmentDataManager * Addressing PR feedback * Remove instance variables * rename private method * renaming stream with partition * lint * kinsis consumer factory should return streamMetadataProvider for both partition and stream level
There is no change in functionality in this PR. The changes are:
LLRealtimeSegmentDataManagerLLRealtimeSegmentDataManagershould always usecreatePartitionMetadataProviderand notcreateStreamMetadataProvider