adarshsanjeev commented on code in PR #13205:
URL: https://github.com/apache/druid/pull/13205#discussion_r1023638488
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -590,7 +599,34 @@ public void updateStatus(int stageNumber, int
workerNumber, Object keyStatistics
);
}
- queryKernel.addResultKeyStatisticsForStageAndWorker(stageId,
workerNumber, keyStatistics);
+ queryKernel.addResultStatisticsReportForStageAndWorker(stageId,
workerNumber, aggregatedKeyStatistics);
+
+ if
(queryKernel.getStagePhase(stageId).equals(ControllerStagePhase.MERGING_STATISTICS))
{
+ List<String> workerTaskIds = workerTaskLauncher.getTaskList();
+ WorkerAggregatedKeyStatistics mergedKeyStatistics =
queryKernel.getAggregatedKeyStatistics(stageId);
+
+ // Queue the sketch fetching task into the worker sketch fetcher.
+ CompletableFuture<Either<Long, ClusterByPartitions>>
clusterByPartitionsCompletableFuture =
+ workerSketchFetcher.submitFetcherTask(
+ mergedKeyStatistics,
+ workerTaskIds,
+ stageDef
+ );
+
+ // Add the listener to handle completion.
+
clusterByPartitionsCompletableFuture.whenComplete((clusterByPartitionsEither,
throwable) -> {
+ if (throwable != null) {
+ queryKernel.failStageForReason(stageId,
UnknownFault.forException(throwable));
+ } else if (clusterByPartitionsEither.isError()) {
+ queryKernel.failStageForReason(stageId, new
TooManyPartitionsFault(stageDef.getMaxPartitionCount()));
+ } else {
+ queryKernel.setClusterByPartitionBoundaries(stageId,
clusterByPartitionsEither.valueOrThrow());
Review Comment:
Moved this to inside the kernalManipulationQueue
--
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]