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

Function MakeIOThreadPool

cpp/src/arrow/io/interfaces.cc:392–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390constexpr int kDefaultNumIoThreads = 8;
391
392std::shared_ptr<ThreadPool> MakeIOThreadPool() {
393 int threads = kDefaultNumIoThreads;
394 auto maybe_num_threads = ::arrow::internal::GetEnvVarInteger(
395 "ARROW_IO_THREADS", /*min_value=*/1, /*max_value=*/std::numeric_limits<int>::max());
396 if (maybe_num_threads.ok()) {
397 threads = static_cast<int>(*maybe_num_threads);
398 } else if (!maybe_num_threads.status().IsKeyError()) {
399 maybe_num_threads.status().Warn();
400 }
401 auto maybe_pool = ThreadPool::MakeEternal(threads);
402 if (!maybe_pool.ok()) {
403 maybe_pool.status().Abort("Failed to create global IO thread pool");
404 }
405 return *std::move(maybe_pool);
406}
407
408} // namespace
409

Callers 1

GetIOThreadPoolFunction · 0.85

Calls 5

GetEnvVarIntegerFunction · 0.85
WarnMethod · 0.80
okMethod · 0.45
statusMethod · 0.45
AbortMethod · 0.45

Tested by

no test coverage detected