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

Method ReadAsync

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

Source from the content-addressed store, hash-verified

141 : ::arrow::io::BufferReader(buffer) {}
142
143 ::arrow::Future<std::shared_ptr<Buffer>> ReadAsync(
144 const ::arrow::io::IOContext& io_context, int64_t position,
145 int64_t nbytes) override {
146 read_async_count.fetch_add(1);
147 auto self = std::dynamic_pointer_cast<DelayedBufferReader>(shared_from_this());
148 return DeferNotOk(::arrow::io::internal::SubmitIO(
149 io_context, [self, position, nbytes]() -> Result<std::shared_ptr<Buffer>> {
150 std::this_thread::sleep_for(std::chrono::seconds(1));
151 return self->DoReadAt(position, nbytes);
152 }));
153 }
154
155 std::atomic<int> read_async_count{0};
156};

Callers 1

Calls 3

DeferNotOkFunction · 0.85
SubmitIOFunction · 0.85
DoReadAtMethod · 0.45

Tested by

no test coverage detected