LakshSingla commented on code in PR #13205:
URL: https://github.com/apache/druid/pull/13205#discussion_r1021437766
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/WorkerImpl.java:
##########
@@ -526,6 +533,30 @@ public void postFinish()
kernelManipulationQueue.add(KernelHolder::setDone);
}
+ @Override
+ public ClusterByStatisticsSnapshot fetchStatisticsSnapshot(StageId stageId)
+ throws ExecutionException, InterruptedException
+ {
+ CompletableFuture<ClusterByStatisticsSnapshot> future = new
CompletableFuture<>();
+ kernelManipulationQueue.add(kernelHolder -> {
+
future.complete(kernelHolder.stageKernelMap.get(stageId).getResultKeyStatisticsSnapshot());
+ });
+ return future.get();
+ }
+
+ @Override
+ public ClusterByStatisticsSnapshot fetchSingletonStatisticsSnapshot(StageId
stageId, long timeChunk)
+ throws ExecutionException, InterruptedException
+ {
+ CompletableFuture<ClusterByStatisticsSnapshot> future = new
CompletableFuture<>();
+ kernelManipulationQueue.add(kernelHolder -> {
+ ClusterByStatisticsSnapshot snapshot =
kernelHolder.stageKernelMap.get(stageId).getResultKeyStatisticsSnapshot();
+ ClusterByStatisticsSnapshot singletonSnapshot =
snapshot.getSingletonSnapshot(timeChunk);
+ future.complete(singletonSnapshot);
+ });
+ return future.get();
Review Comment:
Thanks for the explanation. I generally do it using this method as well, so
I don't have any suggestions.
--
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]