pub trait ListFilesCache: CacheAccessor<TableScopedPath, CachedFileList> {
// 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 cached value is a CachedFileList containing the files and a timestamp.
Partition filtering is done after retrieval using CachedFileList::files_matching_prefix.
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.
Sourcefn drop_table_entries(&self, table_ref: &Option<TableReference>) -> Result<()>
fn drop_table_entries(&self, table_ref: &Option<TableReference>) -> Result<()>
Drop all entries for the given table reference.