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

Function TestNestedParallelism

cpp/src/arrow/csv/reader_test.cc:195–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void TestNestedParallelism(std::shared_ptr<internal::ThreadPool> thread_pool,
196 TableReaderFactory reader_factory) {
197 const int NROWS = 1000;
198 ASSERT_OK_AND_ASSIGN(auto table_buffer, MakeSampleCsvBuffer(NROWS));
199 auto input = std::make_shared<io::BufferReader>(table_buffer);
200 ASSERT_OK_AND_ASSIGN(
201 auto reader, reader_factory(input, ParseOptions::Defaults(), /*block_size=*/{}));
202
203 Future<std::shared_ptr<Table>> table_future;
204
205 auto read_task = [&reader, &table_future]() mutable {
206 table_future = reader->ReadAsync();
207 return Status::OK();
208 };
209 ASSERT_OK_AND_ASSIGN(auto future, thread_pool->Submit(read_task));
210
211 ASSERT_FINISHES_OK(future);
212 ASSERT_FINISHES_OK_AND_ASSIGN(auto table, table_future);
213 ASSERT_EQ(table->num_rows(), NROWS);
214}
215
216void TestInvalidRowsSkipped(TableReaderFactory reader_factory, bool async) {
217 const int NROWS = 1000;

Callers 1

TESTFunction · 0.85

Calls 3

OKFunction · 0.50
ReadAsyncMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected