leventov edited a comment on issue #7571: Optimize coordinator API to retrieve 
segments with overshadowed status
URL: 
https://github.com/apache/incubator-druid/issues/7571#issuecomment-496264473
 
 
   Regarding interning - we have to get rid of them anyway: #7395 explains how. 
If a segment first appears in `BrokerServerView`, it can be created as 
`SegmentWithOvershadowedStatus(isOvershadowed=false)`. Then if it later appears 
in `MetadataSegmentView` and it is not actually overshadowed, we reuse the 
existing object by probing `BrokerServerView`. If the arrived object has 
`isOvershadowed=true`, we just lose the opportunity to deduplicate this 
segment, but we expect it for the minority of segments, so that's fine.
   
   Regarding `SegmentWithOvershadowedStatus(isOvershadowed=false)` objects in 
`BrokerServerView` while the actual status is unknown: it seems weird at first 
glance but it's actually fine. The rule is that to probe `isOvershadowed` 
status we should *always* go through `MetadataSegmentView`. To guard against 
misuse, we can prohibit casting to `SegmentWithOvershadowedStatus` in the 
codebase on the Checkstyle or IntelliJ level.
   
   > What do you mean by 'prohibit' @leventov? I followed the link, and I don't 
see a suggestion about prohibiting equals and hashCode. (Just about prohibiting 
using DataSegments as keys in a map, which seems reasonable, given that usually 
people probably meant to use SegmentId.)
   
   Sorry, I didn't re-check what did I propose there. No, I don't suggest to 
prohibit.  I suggest exactly what is written in 
https://github.com/apache/incubator-druid/issues/6358#issuecomment-489102183.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to