HappenLee commented on code in PR #32180:
URL: https://github.com/apache/doris/pull/32180#discussion_r1546064863


##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -1037,16 +1022,77 @@ Status IRuntimeFilter::publish(bool publish_local) {
     return Status::OK();
 }
 
-Status IRuntimeFilter::push_to_remote(const TNetworkAddress* addr, bool 
opt_remote_rf) {
+Status IRuntimeFilter::send_filter_size(uint64_t local_filter_size) {
     DCHECK(is_producer());
+
+    if (_need_local_merge) {
+        LocalMergeFilters* local_merge_filters = nullptr;
+        
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_local_merge_producer_filters(
+                _filter_id, &local_merge_filters));
+        std::lock_guard l(*local_merge_filters->lock);
+        local_merge_filters->merge_size_times--;
+        local_merge_filters->local_merged_size += local_filter_size;
+        if (local_merge_filters->merge_size_times) {
+            return Status::OK();
+        } else {
+            if (_has_local_target) {
+                for (auto* filter : local_merge_filters->filters) {
+                    
filter->set_global_size(local_merge_filters->local_merged_size);
+                }
+                return Status::OK();
+            } else {
+                local_filter_size = local_merge_filters->local_merged_size;
+            }
+        }
+    } else if (_has_local_target) {
+        set_global_size(local_filter_size);

Review Comment:
   change the name  and add comment



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