weijietong commented on a change in pull request #1504: DRILL-6792: Find the 
right probe side fragment wrapper & fix DrillBuf…
URL: https://github.com/apache/drill/pull/1504#discussion_r229928054
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/filter/RuntimeFilterRouter.java
 ##########
 @@ -125,33 +128,53 @@ public void waitForComplete() {
 
   /**
    * This method is passively invoked by receiving a runtime filter from the 
network
-   * @param runtimeFilterWritable
+   *
+   * @param srcRuntimeFilterWritable
    */
-  public void registerRuntimeFilter(RuntimeFilterWritable 
runtimeFilterWritable) {
-    broadcastAggregatedRuntimeFilter(runtimeFilterWritable);
+  public void register(RuntimeFilterWritable srcRuntimeFilterWritable) {
+    BitData.RuntimeFilterBDef runtimeFilterB = 
srcRuntimeFilterWritable.getRuntimeFilterBDef();
+    int joinMajorId = runtimeFilterB.getMajorFragmentId();
+    int buildSideRfNumber;
+    RuntimeFilterWritable toAggregated;
+    synchronized (this) {
+      buildSideRfNumber = joinMjId2rfNumber.get(joinMajorId);
+      buildSideRfNumber--;
+      joinMjId2rfNumber.put(joinMajorId, buildSideRfNumber);
+      toAggregated = joinMjId2AggregatedRF.get(joinMajorId);
+      if (toAggregated == null) {
+        toAggregated = srcRuntimeFilterWritable;
+        toAggregated.retainBuffers(1);
+      } else {
+        toAggregated.aggregate(srcRuntimeFilterWritable);
+      }
+      joinMjId2AggregatedRF.put(joinMajorId, toAggregated);
+    }
+    if (buildSideRfNumber == 0) {
 
 Review comment:
   I think this local stack variable doesn’t need to be in the blocking 
nodes.It’s safe to check it. I don’t want the broadcasting work happened at 
this blocking boundary.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to