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

Function MakeAsyncFactory

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

Source from the content-addressed store, hash-verified

269}
270
271Result<TableReaderFactory> MakeAsyncFactory(
272 std::shared_ptr<internal::ThreadPool> thread_pool = nullptr) {
273 if (!thread_pool) {
274 ARROW_ASSIGN_OR_RAISE(thread_pool, internal::ThreadPool::Make(1));
275 }
276 return [thread_pool](
277 std::shared_ptr<io::InputStream> input_stream, ParseOptions parse_options,
278 std::optional<int32_t> block_size) -> Result<std::shared_ptr<TableReader>> {
279 ReadOptions read_options = ReadOptions::Defaults();
280 read_options.use_threads = true;
281 read_options.block_size = block_size.value_or(1 << 10);
282 auto table_reader =
283 TableReader::Make(io::IOContext(thread_pool.get()), input_stream, read_options,
284 std::move(parse_options), ConvertOptions::Defaults());
285 return table_reader;
286 };
287}
288
289TEST(AsyncReaderTests, Empty) {
290 ASSERT_OK_AND_ASSIGN(auto table_factory, MakeAsyncFactory());

Callers

nothing calls this directly

Calls 5

ARROW_ASSIGN_OR_RAISEFunction · 0.50
MakeFunction · 0.50
DefaultsFunction · 0.50
IOContextClass · 0.50
getMethod · 0.45

Tested by

no test coverage detected