yiguolei commented on code in PR #20216:
URL: https://github.com/apache/doris/pull/20216#discussion_r1209755526


##########
be/src/vec/exec/join/grace_hash_join_node.h:
##########
@@ -0,0 +1,302 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+#include <atomic>
+#include <cstdint>
+#include <memory>
+#include <mutex>
+
+#include "common/status.h"
+#include "util/countdown_latch.h"
+#include "vec/exec/join/vhash_join_node.h"
+#include "vec/spill/spill_stream.h"
+
+namespace doris {
+namespace vectorized {
+
+using InMemoryHashJoinNodeUPtr = std::unique_ptr<HashJoinNode>;
+
+class GraceHashJoinNode;
+
+class JoinPartition {
+public:
+    JoinPartition(GraceHashJoinNode* parent) : parent_(parent) {}
+    Status prepare(RuntimeState* state, RuntimeProfile* profile, const 
std::string& operator_name,
+                   int node_id);
+
+    Status prepare_add_build_rows(Block* block, std::vector<int>& rows);
+    Status add_build_rows(Block* block, std::vector<int>& rows);
+
+    Status prepare_add_probe_rows(Block* block, std::vector<int>& rows);
+    Status add_probe_rows(RuntimeState* state, Block* block, std::vector<int>& 
rows, bool eos);
+
+    Status add_probe_block(Block& block) {
+        probe_stream_->add_block(block);
+        return Status::OK();
+    }
+    Status push_probe_block(Block& block) {
+        // in_mem_hash_join_node_->push(block);
+        return Status::OK();
+    }
+
+    // force spill build blocks
+    Status flush_build_stream_async(const flush_stream_callback& 
flush_callback) {
+        if (!mutable_build_block_->empty()) {
+            auto block = mutable_build_block_->to_block();
+            build_stream_->add_block(block);
+            mutable_build_block_->clear_column_data();
+        }
+        return build_stream_->flush(flush_callback);
+    }
+
+    Status flush_probe_stream_async(const flush_stream_callback& 
flush_callback) {
+        if (!mutable_probe_block_->empty()) {
+            auto block = mutable_probe_block_->to_block();
+            probe_stream_->add_block(block);
+            mutable_probe_block_->clear_column_data();
+        }
+        return probe_stream_->flush(flush_callback);
+    }
+
+    bool build_stream_can_write() const { return !is_flushing_build_stream(); }

Review Comment:
   这堆方法都需要public 吗?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to