pub struct CacheManagerConfig {
pub table_files_statistics_cache: Option<Arc<dyn FileStatisticsCache>>,
pub list_files_cache: Option<Arc<dyn ListFilesCache>>,
pub list_files_cache_limit: usize,
pub list_files_cache_ttl: Option<Duration>,
pub file_metadata_cache: Option<Arc<dyn FileMetadataCache>>,
pub metadata_cache_limit: usize,
}Fields§
§table_files_statistics_cache: Option<Arc<dyn FileStatisticsCache>>Enable caching of file statistics when listing files. Enabling the cache avoids repeatedly reading file statistics in a DataFusion session. Default is disabled. Currently only Parquet files are supported.
list_files_cache: Option<Arc<dyn ListFilesCache>>Enable caching of file metadata when listing files.
Enabling the cache avoids repeat list and object metadata fetch operations, which may be
expensive in certain situations (e.g. remote object storage), for objects under paths that
are cached.
Note that if this option is enabled, DataFusion will not see any updates to the underlying
storage for at least list_files_cache_ttl duration.
Default is disabled.
list_files_cache_limit: usizeLimit of the list_files_cache, in bytes. Default: 1MiB.
list_files_cache_ttl: Option<Duration>The duration the list files cache will consider an entry valid after insertion. Note that changes to the underlying storage system, such as adding or removing data, will not be visible until an entry expires. Default: None (infinite).
file_metadata_cache: Option<Arc<dyn FileMetadataCache>>Cache of file-embedded metadata, used to avoid reading it multiple times when processing a
data file (e.g., Parquet footer and page metadata).
If not provided, the CacheManager will create a DefaultFilesMetadataCache.
metadata_cache_limit: usizeLimit of the file-embedded metadata cache, in bytes.
Implementations§
Source§impl CacheManagerConfig
impl CacheManagerConfig
Sourcepub fn with_files_statistics_cache(
self,
cache: Option<Arc<dyn FileStatisticsCache>>,
) -> Self
pub fn with_files_statistics_cache( self, cache: Option<Arc<dyn FileStatisticsCache>>, ) -> Self
Set the cache for files statistics.
Default is None (disabled).
Sourcepub fn with_list_files_cache(
self,
cache: Option<Arc<dyn ListFilesCache>>,
) -> Self
pub fn with_list_files_cache( self, cache: Option<Arc<dyn ListFilesCache>>, ) -> Self
Set the cache for listing files.
Default is None (disabled).
Sourcepub fn with_list_files_cache_limit(self, limit: usize) -> Self
pub fn with_list_files_cache_limit(self, limit: usize) -> Self
Sets the limit of the list files cache, in bytes.
Default: 1MiB (1,048,576 bytes).
Sourcepub fn with_list_files_cache_ttl(self, ttl: Option<Duration>) -> Self
pub fn with_list_files_cache_ttl(self, ttl: Option<Duration>) -> Self
Sets the TTL (time-to-live) for entries in the list files cache.
Default: None (infinite).
Sourcepub fn with_file_metadata_cache(
self,
cache: Option<Arc<dyn FileMetadataCache>>,
) -> Self
pub fn with_file_metadata_cache( self, cache: Option<Arc<dyn FileMetadataCache>>, ) -> Self
Sets the cache for file-embedded metadata.
Default is a DefaultFilesMetadataCache.
Sourcepub fn with_metadata_cache_limit(self, limit: usize) -> Self
pub fn with_metadata_cache_limit(self, limit: usize) -> Self
Sets the limit of the file-embedded metadata cache, in bytes.
Trait Implementations§
Source§impl Clone for CacheManagerConfig
impl Clone for CacheManagerConfig
Source§fn clone(&self) -> CacheManagerConfig
fn clone(&self) -> CacheManagerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CacheManagerConfig
impl !RefUnwindSafe for CacheManagerConfig
impl Send for CacheManagerConfig
impl Sync for CacheManagerConfig
impl Unpin for CacheManagerConfig
impl !UnwindSafe for CacheManagerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more