ccaominh commented on a change in pull request #9407: query laning and load
shedding
URL: https://github.com/apache/druid/pull/9407#discussion_r388667087
##########
File path:
sql/src/test/java/org/apache/druid/sql/calcite/util/SpecificSegmentsQuerySegmentWalker.java
##########
@@ -388,13 +410,33 @@ public SegmentDescriptor getDescriptor()
toolChest
);
+
// Wrap baseRunner in a runner that rewrites the QuerySegmentSpec to
mention the specific segments.
// This mimics what CachingClusteredClient on the Broker does, and is
required for certain queries (like Scan)
// to function properly.
- return (theQuery, responseContext) -> baseRunner.run(
- theQuery.withQuery(Queries.withSpecificSegments(theQuery.getQuery(),
ImmutableList.copyOf(specs))),
- responseContext
- );
+ return (theQuery, responseContext) -> {
+ if (scheduler != null) {
+ Set<SegmentServerSelector> segments = new HashSet<>();
+ specs.forEach(spec -> segments.add(new SegmentServerSelector(null,
spec)));
+ return scheduler.run(
+ scheduler.laneQuery(theQuery, segments),
+ new LazySequence<>(
+ () -> baseRunner.run(
+ theQuery.withQuery(Queries.withSpecificSegments(
+ theQuery.getQuery(),
+ ImmutableList.copyOf(specs)
+ )),
+ responseContext
+ )
+ )
+ );
Review comment:
Which tests cover this block?
----------------------------------------------------------------
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]