Skip to main content

ListFilesCache

Trait ListFilesCache 

Source
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§

Source

fn cache_limit(&self) -> usize

Returns the cache’s memory limit in bytes.

Source

fn cache_ttl(&self) -> Option<Duration>

Returns the TTL (time-to-live) for cache entries, if configured.

Source

fn update_cache_limit(&self, limit: usize)

Updates the cache with a new memory limit in bytes.

Source

fn update_cache_ttl(&self, ttl: Option<Duration>)

Updates the cache with a new TTL (time-to-live).

Source

fn list_entries(&self) -> HashMap<TableScopedPath, ListFilesEntry>

Retrieves the information about the entries currently cached.

Source

fn drop_table_entries(&self, table_ref: &Option<TableReference>) -> Result<()>

Drop all entries for the given table reference.

Trait Implementations§

Source§

impl Debug for dyn ListFilesCache

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§