leventov commented on issue #6370: Introduce SegmentId class
URL: https://github.com/apache/incubator-druid/pull/6370#issuecomment-451866399
 
 
   @drcrallen 
   
   > Would it be possible to use a SegmentId interface everywhere, and simply 
have implementations similar to how LegacyDataSource works?
   
   I'm not sure what did you mean. This PR replaces `String` with `SegmentId` 
in all contexts except the following two:
    1) Where `SegmentIdWithShardSpec` is already used. (Before this PR that 
class was called `SegmentIdentifier`, I renamed it to `SegmentIdWithShardSpec` 
to distinguish from `SegmentId`.) It's usually on the segment producing side of 
things, i. e. indexing. There is an explanation why it was decided to keep 
those two classes separate here: 
https://github.com/apache/incubator-druid/pull/6370/files#diff-bf0e586a3230572aa5c06beffc434b3fR34
    2) In query result POJOs, where a segment id is transmitted from 
historicals to brokers alongs with results. There are comments in such sites 
explaining why `SegmentId` couldn't be used there, e. g. here: 
https://github.com/apache/incubator-druid/pull/6370/files#diff-bd80080a4bcd88fdc21ec62919733e76R35
   
   > Another question is if we even need the identifier field in the metadata 
anymore. If the uniqueness of a segment is a tuple of datasource, interval, 
version, and partition (which I think is correct) all that information is 
elsewhere in the metadata. Having an ID field explicitly doesn't get you much, 
or anything?
   
   `SegmentId` is not just "id", it's a useful metadata container, its fields 
are used. Note that this PR removes some fields from `DataSegment`, because 
they are duplicated by `SegmentId`: 
https://github.com/apache/incubator-druid/pull/6370/files#diff-93f2cf9022ac4126afc3ee5989f4f5bfL102

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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