Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
| /** | |
| * This file is licensed to you under the Apache License, Version 2.0 (the | |
| * "License"); you may not use this file except in compliance with the | |
| * License. You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| %% Get current number of online schedulers | |
| Schedulers = erlang:system_info(schedulers_online). | |
| %% Reduce number online to 1 | |
| erlang:system_flag(schedulers_online, 1). | |
| %% Restore to original number of online schedulers | |
| erlang:system_flag(schedulers_online, Schedulers). |
| import duckdb | |
| from google.cloud import bigquery | |
| bqclient = bigquery.Client() | |
| table = bigquery.TableReference.from_string( | |
| "bigquery-public-data.utility_us.country_code_iso" | |
| ) | |
| rows = bqclient.list_rows(table) | |
| country_code_iso = rows.to_arrow(create_bqstorage_client=True) | |
| cursor = duckdb.connect() |