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

Method Init

cpp/src/arrow/csv/reader.cc:842–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840 bytes_decoded_(std::make_shared<std::atomic<int64_t>>(0)) {}
841
842 Future<> Init(Executor* cpu_executor) {
843 ARROW_ASSIGN_OR_RAISE(auto istream_it,
844 io::MakeInputStreamIterator(input_, read_options_.block_size));
845
846 // TODO Consider exposing readahead as a read option (ARROW-12090)
847 ARROW_ASSIGN_OR_RAISE(auto bg_it, MakeBackgroundGenerator(std::move(istream_it),
848 io_context_.executor()));
849
850 auto transferred_it = MakeTransferredGenerator(bg_it, cpu_executor);
851
852 auto buffer_generator = CSVBufferIterator::MakeAsync(std::move(transferred_it));
853
854 int max_readahead = cpu_executor->GetCapacity();
855 auto self = shared_from_this();
856
857 return buffer_generator().Then([self, buffer_generator, max_readahead](
858 const std::shared_ptr<Buffer>& first_buffer) {
859 return self->InitAfterFirstBuffer(first_buffer, buffer_generator, max_readahead);
860 });
861 }
862
863 std::shared_ptr<Schema> schema() const override { return schema_; }
864

Callers

nothing calls this directly

Calls 4

InitAfterFirstBufferMethod · 0.95
MakeTransferredGeneratorFunction · 0.85
ThenMethod · 0.80
GetCapacityMethod · 0.45

Tested by

no test coverage detected