Class MapQueryCache

    • Constructor Detail

      • MapQueryCache

        public MapQueryCache()
      • MapQueryCache

        public MapQueryCache​(int maxSize)
    • Method Detail

      • get

        public List get​(QueryMetadata metadata)
        Description copied from interface: QueryCache
        Returns a cached query result for the given QueryMetadata or null if the result is not cached or is expired.
        Specified by:
        get in interface QueryCache
      • get

        public List get​(QueryMetadata metadata,
                        QueryCacheEntryFactory factory)
        Returns a non-null cached value. If it is not present in the cache, it is obtained by calling QueryCacheEntryFactory.createObject() without blocking the cache. As a result there is a potential of multiple threads to be updating cache in parallel - this wouldn't lead to corruption of the cache, but can be suboptimal.
        Specified by:
        get in interface QueryCache
      • remove

        public void remove​(String key)
        Description copied from interface: QueryCache
        Removes a single entry from cache.
        Specified by:
        remove in interface QueryCache
      • removeGroup

        public void removeGroup​(String groupKey)
        Description copied from interface: QueryCache
        Removes a group of entries identified by group key. Note that depending on implementation this method may either actively remove the entries belonging to the group or just mark them as expired, so that they are refreshed on the next access. In the former case the cache size would shrink, but in the later the cache size will not change after calling this method.
        Specified by:
        removeGroup in interface QueryCache
      • clear

        public void clear()
        Description copied from interface: QueryCache
        Clears all cache entries.
        Specified by:
        clear in interface QueryCache
      • size

        public int size()