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