Skip to content

Commit ad51b6a

Browse files
committed
refactor: change obj cache method names and use more readable default usize value
1 parent 676398d commit ad51b6a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/iceberg/src/io/object_cache.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::spec::{
2323
};
2424
use crate::{Error, ErrorKind, Result};
2525

26-
const DEFAULT_CACHE_SIZE_BYTES: u64 = 2 ^ 15; // 32MB
26+
const DEFAULT_CACHE_SIZE_BYTES: u64 = 32 * 1024 * 1024; // 32MB
2727

2828
#[derive(Clone, Debug)]
2929
pub(crate) enum CachedItem {
@@ -49,12 +49,12 @@ impl ObjectCache {
4949
/// Creates a new [`ObjectCache`]
5050
/// with the default cache size
5151
pub(crate) fn new(file_io: FileIO) -> Self {
52-
Self::new_with_cache_size(file_io, DEFAULT_CACHE_SIZE_BYTES)
52+
Self::new_with_capacity(file_io, DEFAULT_CACHE_SIZE_BYTES)
5353
}
5454

5555
/// Creates a new [`ObjectCache`]
5656
/// with a specific cache size
57-
pub(crate) fn new_with_cache_size(file_io: FileIO, cache_size_bytes: u64) -> Self {
57+
pub(crate) fn new_with_capacity(file_io: FileIO, cache_size_bytes: u64) -> Self {
5858
if cache_size_bytes == 0 {
5959
Self::with_disabled_cache(file_io)
6060
} else {

crates/iceberg/src/spec/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Manifest {
9595
}
9696

9797
/// Consume this Manifest, returning its constituent parts
98-
pub fn consume(self) -> (Vec<ManifestEntryRef>, ManifestMetadata) {
98+
pub fn into_parts(self) -> (Vec<ManifestEntryRef>, ManifestMetadata) {
9999
let Self { entries, metadata } = self;
100100
(entries, metadata)
101101
}

crates/iceberg/src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl TableBuilder {
130130
let object_cache = if disable_cache {
131131
Arc::new(ObjectCache::with_disabled_cache(file_io.clone()))
132132
} else if let Some(cache_size_bytes) = cache_size_bytes {
133-
Arc::new(ObjectCache::new_with_cache_size(
133+
Arc::new(ObjectCache::new_with_capacity(
134134
file_io.clone(),
135135
cache_size_bytes,
136136
))

0 commit comments

Comments
 (0)