Skip to content

Commit

Permalink
fix: ensure object cache weight is that of the wrapped item, not the Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Aug 19, 2024
1 parent b4b8c01 commit f184c97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/iceberg/src/io/object_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ impl ObjectCache {
} else {
Self {
cache: moka::future::Cache::builder()
.weigher(|_, val: &CachedItem| size_of_val(val) as u32)
.weigher(|_, val: &CachedItem| match val {
CachedItem::ManifestList(item) => size_of_val(item.as_ref()),
CachedItem::Manifest(item) => size_of_val(item.as_ref()),
} as u32)
.max_capacity(cache_size_bytes)
.build(),
file_io,
Expand Down

0 comments on commit f184c97

Please sign in to comment.