| 390 | constexpr int kDefaultNumIoThreads = 8; |
| 391 | |
| 392 | std::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 |
no test coverage detected