com.ibm.storage.clientlibrary

Interface Cache<K,V>

    • Method Detail

      • clear

        void clear()
        delete all entries from the cache
      • delete

        void delete(K key)
        delete a key-value pair from the cache
        Parameters:
        key - key corresponding to value
      • deleteAll

        void deleteAll(List<K> keys)
        delete one or more key-value pairs from the cache
        Parameters:
        keys - iterable data structure containing the keys to delete
      • get

        V get(K key)
        look up a value in the cache
        Parameters:
        key - key corresponding to value
        Returns:
        value corresponding to key, null if key is not in cache or if value is expired
      • getAll

        Map<K,V> getAll(List<K> keys)
        look up one or more values in the cache. Don't return expired values.
        Parameters:
        keys - iterable data structure containing the keys to look up
        Returns:
        map containing key-value pairs corresponding to unexpired data in the cache
      • getCacheEntry

        CacheEntry<V> getCacheEntry(K key)
        look up a CacheEntry in the cache. The CacheEntry may correspond to expired data. This method can be used to revalidate cached objects whose expiration times have passed
        Parameters:
        key - key corresponding to value
        Returns:
        value corresponding to key (may be expired), null if key is not in cache
      • getStatistics

        Stats getStatistics()
        get cache statistics
        Returns:
        data structure containing statistics
      • put

        void put(K key,
                 V value)
        cache a key-value pair
        Parameters:
        key - key associated with value
        value - value associated with key
      • putAll

        void putAll(Map<K,V> map)
        cache one or more key-value pairs
        Parameters:
        map - map containing key-value pairs to cache
      • size

        long size()
        Return number of objects in cache
        Returns:
        number of objects in cache

Copyright © 2015. All rights reserved.