Skip to content

Commit

Permalink
refactor: replace num_cpus with thread::available_parallelism (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored Aug 7, 2024
1 parent abe3a64 commit ded5926
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ itertools = "0.13"
log = "^0.4"
mockito = "^1"
murmur3 = "0.5.2"
num_cpus = "1"
once_cell = "1"
opendal = "0.48"
ordered-float = "4.0.0"
Expand Down
1 change: 0 additions & 1 deletion crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fnv = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
murmur3 = { workspace = true }
num_cpus = { workspace = true }
once_cell = { workspace = true }
opendal = { workspace = true }
ordered-float = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion crates/iceberg/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ pub struct TableScanBuilder<'a> {

impl<'a> TableScanBuilder<'a> {
pub(crate) fn new(table: &'a Table) -> Self {
let num_cpus = num_cpus::get();
let num_cpus = std::thread::available_parallelism()
.expect("failed to get number of CPUs")
.get();

Self {
table,
Expand Down

0 comments on commit ded5926

Please sign in to comment.