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

Method Init

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

Source from the content-addressed store, hash-verified

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

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