Jackie-Jiang commented on issue #4722: Fix segmentMetadata for MutableSegment
URL: https://github.com/apache/incubator-pinot/pull/4722#issuecomment-544220289
 
 
   > > Why do you need the class to be the same? As long as you can cast it to 
`SegmentMetadataImpl` (a subclass of `SegmentMetadataImpl`), you should be able 
to call all its API.
   > > We should not allow setters for SegmentMetadata.
   > 
   > It seems ok casting to `SegmentMetadataImpl` where I'm using it - just 
looks weird SegmentMetadata being a MutableSegment class, and need to cast it 
wherever it's used to avoid potential issues.
   > 
   > Is it required to have no setters for SegmentMetadata? Overriding the 
getter methods kind of shows there is such need for mutable segments.
   
   The `SegmentMetadata` interface should not have any setters (segment 
metadata represents the state of the segment, and allow user to set it seems 
weird to me).
   I agree it looks weird to have `SegmentMetadataImpl` inside MutableSegment. 
The reason why we override `SegmentMetadataImpl` instead of implementing 
`SegmentMetadata` (which is cleaner) for MutableSegment is because some 
historical package issue, where `SegmentMetadata` interface cannot include 
`ColumnMetadata`, and this is also the reason why we have to cast the 
`SegmentMetadata` to `SegmentMetadataImpl` in order to read `ColumnMetadata`.
   Long term wise, we want to re-organize the package so that `SegmentMetadata` 
can include `ColumnMetadata`, and MutableSegment should implement its own 
segment metadata.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to