Trait datafusion_execution::cache::CacheAccessor

source ·
pub trait CacheAccessor<K, V>: Send + Sync {
    type Extra: Clone;

    // Required methods
    fn get(&self, k: &K) -> Option<V>;
    fn get_with_extra(&self, k: &K, e: &Self::Extra) -> Option<V>;
    fn put(&self, key: &K, value: V) -> Option<V>;
    fn put_with_extra(&self, key: &K, value: V, e: &Self::Extra) -> Option<V>;
    fn remove(&mut self, k: &K) -> Option<V>;
    fn contains_key(&self, k: &K) -> bool;
    fn len(&self) -> usize;
    fn clear(&self);
    fn name(&self) -> String;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

The cache accessor, users usually working on this interface while manipulating caches. This interface does not get mut references and thus has to handle its own locking via internal mutability. It can be accessed via multiple concurrent queries during planning and execution.

Required Associated Types§

Required Methods§

source

fn get(&self, k: &K) -> Option<V>

Get value from cache.

source

fn get_with_extra(&self, k: &K, e: &Self::Extra) -> Option<V>

Get value from cache.

source

fn put(&self, key: &K, value: V) -> Option<V>

Put value into cache. Returns the old value associated with the key if there was one.

source

fn put_with_extra(&self, key: &K, value: V, e: &Self::Extra) -> Option<V>

Put value into cache. Returns the old value associated with the key if there was one.

source

fn remove(&mut self, k: &K) -> Option<V>

Remove an entry from the cache, returning value if they existed in the map.

source

fn contains_key(&self, k: &K) -> bool

Check if the cache contains a specific key.

source

fn len(&self) -> usize

Fetch the total number of cache entries.

source

fn clear(&self)

Remove all entries from the cache.

source

fn name(&self) -> String

Return the cache name.

Provided Methods§

source

fn is_empty(&self) -> bool

Check if the Cache collection is empty or not.

Trait Implementations§

source§

impl Debug for dyn CacheAccessor<Path, Arc<Statistics>, Extra = ObjectMeta>

source§

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

Formats the value using the given formatter. Read more
source§

impl Debug for dyn CacheAccessor<Path, Arc<Vec<ObjectMeta>>, Extra = ObjectMeta>

source§

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

Formats the value using the given formatter. Read more

Implementors§