pub trait FileStatisticsCache: CacheAccessor<TableScopedPath, CachedFileMetadata> {
// Required methods
fn cache_limit(&self) -> usize;
fn update_cache_limit(&self, limit: usize);
fn list_entries(&self) -> HashMap<TableScopedPath, FileStatisticsCacheEntry>;
fn drop_table_entries(
&self,
table_ref: &Option<TableReference>,
) -> Result<()>;
}Expand description
A cache for file statistics and orderings.
This cache stores CachedFileMetadata which includes:
- File metadata for validation (size, last_modified)
- Statistics for the file
- Ordering information for the file
If enabled via CacheManagerConfig::with_file_statistics_cache this
cache avoids inferring the same file statistics repeatedly during the
session lifetime.
The typical usage pattern is:
- Call
get(path)to check for cached value - If
Some(cached), validate withcached.is_valid_for(¤t_meta) - If invalid or missing, compute new value and call
put(path, new_value)
See crate::runtime_env::RuntimeEnv for more details
Required Methods§
Sourcefn cache_limit(&self) -> usize
fn cache_limit(&self) -> usize
Cache memory limit in bytes.
Sourcefn update_cache_limit(&self, limit: usize)
fn update_cache_limit(&self, limit: usize)
Updates the cache with a new memory limit in bytes.
Sourcefn list_entries(&self) -> HashMap<TableScopedPath, FileStatisticsCacheEntry>
fn list_entries(&self) -> HashMap<TableScopedPath, FileStatisticsCacheEntry>
Retrieves the information about the entries currently cached.
fn drop_table_entries(&self, table_ref: &Option<TableReference>) -> Result<()>
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".