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

Method Init

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

Source from the content-addressed store, hash-verified

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

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