sohami 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_r229908466
 
 

 ##########
 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);
 
 Review comment:
   why we need to `retainBuffers` here again ? Caller is already retaining this 
buffer once.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to