jon-wei commented on a change in pull request #11398:
URL: https://github.com/apache/druid/pull/11398#discussion_r668979443
##########
File path:
server/src/main/java/org/apache/druid/segment/loading/SegmentLoaderLocalCacheManager.java
##########
@@ -203,8 +219,8 @@ public Segment getSegment(DataSegment segment, boolean
lazy, SegmentLazyLoadFail
} else {
factory = new MMappedQueryableSegmentizerFactory(indexIO);
}
-
- return factory.factorize(segment, segmentFiles, lazy, loadFailed);
+ Segment baseSegment = factory.factorize(segment, segmentFiles, lazy,
loadFailed);
+ return ReferenceCountingSegment.wrapSegment(baseSegment,
segment.getShardSpec());
Review comment:
Before, the DataSegment was an immutable object, so recreating it didn't
really matter. Conceptually, there's only 1 copy of a segment on a historical,
so having multiple potentially different views of how many references it has
seems odd to me.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]