clintropolis commented on code in PR #18176:
URL: https://github.com/apache/druid/pull/18176#discussion_r2291846709
##########
server/src/main/java/org/apache/druid/server/ServerManager.java:
##########
@@ -233,23 +287,37 @@ protected <T> FunctionalIterable<QueryRunner<T>>
getQueryRunnersForSegments(
final Closer closer
)
{
+ final List<SegmentReference> segmentReferences;
+ // this is kind of gross, but otherwise we're going to be loading weak
assignments more or less as soon as they
+ // are assigned instead of on demand at query time
+ if (query instanceof SegmentMetadataQuery) {
+ segmentReferences = getSegmentMetadataSegmentReferences(timeline, specs,
segmentMapFn);
+ } else {
+ segmentReferences = getAndLoadAllSegmentReferences(
+ timeline,
+ specs,
+ segmentMapFn,
+ query.context().getTimeout()
+ );
+ }
return FunctionalIterable
- .create(acquireAllSegments(timeline, specs, segmentMapFn, closer))
+ .create(segmentReferences)
.transform(
ref ->
- ref.getSegmentReference()
- .map(segment ->
- buildQueryRunnerForSegment(
- ref.getSegmentDescriptor(),
- segment,
- factory,
- toolChest,
- cpuTimeAccumulator,
- cacheKeyPrefix
- )
- ).orElse(
- new
ReportTimelineMissingSegmentQueryRunner<>(ref.getSegmentDescriptor())
- )
+ closer.register(ref)
Review Comment:
pulled registering with closer out of this to prevent any of ^ from happening
--
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]