MCPcopy Create free account
hub / github.com/apache/arrow / Start

Method Start

cpp/src/arrow/dataset/dataset_writer.cc:143–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 : options_(options), schema_(schema), writer_state_(std::move(writer_state)) {}
142
143 void Start(std::unique_ptr<util::ThrottledAsyncTaskScheduler> file_tasks,
144 std::string filename) {
145 file_tasks_ = std::move(file_tasks);
146 // Because the scheduler runs one task at a time we know the writer will
147 // be opened before any attempt to write
148 file_tasks_->AddSimpleTask(
149 [self = shared_from_this(), filename = std::move(filename)] {
150 Executor* io_executor = self->options_.filesystem->io_context().executor();
151 return DeferNotOk(io_executor->Submit([self, filename = std::move(filename)]() {
152 ARROW_ASSIGN_OR_RAISE(self->writer_,
153 OpenWriter(self->options_, self->schema_, filename));
154 return Status::OK();
155 }));
156 },
157 "DatasetWriter::OpenWriter"sv);
158 }
159
160 void Abort() {
161 // The scheduler may be keeping this object alive through shared_ptr references

Callers 1

OpenFileQueueMethod · 0.45

Calls 5

DeferNotOkFunction · 0.85
OpenWriterFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
executorMethod · 0.45

Tested by

no test coverage detected