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

Function TestNestedParallelism

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

Source from the content-addressed store, hash-verified

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