| 320 | class FileWriterImpl : public FileWriter { |
| 321 | public: |
| 322 | FileWriterImpl(std::shared_ptr<::arrow::Schema> schema, MemoryPool* pool, |
| 323 | std::unique_ptr<ParquetFileWriter> writer, |
| 324 | std::shared_ptr<ArrowWriterProperties> arrow_properties) |
| 325 | : schema_(std::move(schema)), |
| 326 | writer_(std::move(writer)), |
| 327 | row_group_writer_(nullptr), |
| 328 | column_write_context_(pool, arrow_properties.get()), |
| 329 | arrow_properties_(std::move(arrow_properties)), |
| 330 | closed_(false) { |
| 331 | if (arrow_properties_->use_threads()) { |
| 332 | parallel_column_write_contexts_.reserve(schema_->num_fields()); |
| 333 | for (int i = 0; i < schema_->num_fields(); ++i) { |
| 334 | // Explicitly create each ArrowWriteContext object to avoid unintentional |
| 335 | // call of the copy constructor. Otherwise, the buffers in the type of |
| 336 | // shared_ptr will be shared among all contexts. |
| 337 | parallel_column_write_contexts_.emplace_back(pool, arrow_properties_.get()); |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | Status Init() { |
| 343 | return SchemaManifest::Make(writer_->schema(), /*schema_metadata=*/nullptr, |
nothing calls this directly
no test coverage detected