@@ -40,8 +40,8 @@ class PAIMON_EXPORT WriteContext {
4040 public:
4141 WriteContext (const std::string& root_path, const std::string& commit_user,
4242 bool is_streaming_mode, bool ignore_num_bucket_check, bool ignore_previous_files,
43- const std::optional<int32_t >& write_id, const std::string& branch ,
44- const std::vector<std::string>& write_schema,
43+ bool enable_multi_thread_spill, const std::optional<int32_t >& write_id,
44+ const std::string& branch, const std:: vector<std::string>& write_schema,
4545 const std::shared_ptr<MemoryPool>& memory_pool,
4646 const std::shared_ptr<Executor>& executor, const std::string& temp_directory,
4747 const std::shared_ptr<FileSystem>& specific_file_system,
@@ -106,13 +106,18 @@ class PAIMON_EXPORT WriteContext {
106106 return specific_file_system_;
107107 }
108108
109+ bool EnableMultiThreadSpill () const {
110+ return enable_multi_thread_spill_;
111+ }
112+
109113 private:
110114 std::string root_path_;
111115 std::string commit_user_;
112116 std::string branch_;
113117 bool is_streaming_mode_;
114118 bool ignore_num_bucket_check_;
115119 bool ignore_previous_files_;
120+ bool enable_multi_thread_spill_;
116121 std::optional<int32_t > write_id_;
117122 std::vector<std::string> write_schema_;
118123 std::shared_ptr<MemoryPool> memory_pool_;
@@ -222,6 +227,13 @@ class PAIMON_EXPORT WriteContextBuilder {
222227 WriteContextBuilder& WithFileSystemSchemeToIdentifierMap (
223228 const std::map<std::string, std::string>& fs_scheme_to_identifier_map);
224229
230+ // / Set the thread number for write buffer spill operations. (default is 0)
231+ // / If <= 0, threading is disabled for spill IPC read/write.
232+ // / If > 0, sets arrow CPU thread pool capacity for spill operations.
233+ // / @param thread_number The thread number to use for spill operations.
234+ // / @return Reference to this builder for method chaining.
235+ WriteContextBuilder& SetWriteBufferSpillThreadNumber (int32_t thread_number);
236+
225237 // / Build and return a `WriteContext` instance with input validation.
226238 // / @return Result containing the constructed `WriteContext` or an error status.
227239 Result<std::unique_ptr<WriteContext>> Finish ();
0 commit comments