LakshSingla commented on code in PR #13205:
URL: https://github.com/apache/druid/pull/13205#discussion_r1021457604


##########
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:
   Ohh okay, I think this should be cool in that case. 



-- 
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]

Reply via email to