pub trait ListFilesCache: CacheAccessor<TableScopedPath, Arc<Vec<ObjectMeta>>, Extra = Option<Path>> {
// Required methods
fn cache_limit(&self) -> usize;
fn cache_ttl(&self) -> Option<Duration>;
fn update_cache_limit(&self, limit: usize);
fn update_cache_ttl(&self, ttl: Option<Duration>);
fn list_entries(&self) -> HashMap<TableScopedPath, ListFilesEntry>;
fn drop_table_entries(
&self,
table_ref: &Option<TableReference>,
) -> Result<()>;
}Expand description
Cache for storing the ObjectMetas that result from listing a path
Listing a path means doing an object store “list” operation or ls
command on the local filesystem. This operation can be expensive,
especially when done over remote object stores.
The cache key is always the table’s base path, ensuring a stable cache key.
The Extra type is Option<Path>, representing an optional prefix filter
(relative to the table base path) for partition-aware lookups.
When get_with_extra(key, Some(prefix)) is called:
- The cache entry for
key(table base path) is fetched - Results are filtered to only include files matching
key/prefix - Filtered results are returned without making a storage call
This enables efficient partition pruning: a single cached listing of the full table can serve queries for any partition subset.
See crate::runtime_env::RuntimeEnv for more details.
Required Methods§
Sourcefn cache_limit(&self) -> usize
fn cache_limit(&self) -> usize
Returns the cache’s memory limit in bytes.
Sourcefn cache_ttl(&self) -> Option<Duration>
fn cache_ttl(&self) -> Option<Duration>
Returns the TTL (time-to-live) for cache entries, if configured.
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 update_cache_ttl(&self, ttl: Option<Duration>)
fn update_cache_ttl(&self, ttl: Option<Duration>)
Updates the cache with a new TTL (time-to-live).
Sourcefn list_entries(&self) -> HashMap<TableScopedPath, ListFilesEntry>
fn list_entries(&self) -> HashMap<TableScopedPath, ListFilesEntry>
Retrieves the information about the entries currently cached.