Class ConcurrentQueryCache

    • Field Detail

      • _lru

        protected boolean _lru
    • Constructor Detail

      • ConcurrentQueryCache

        public ConcurrentQueryCache()
    • Method Detail

      • getCacheMap

        public CacheMap getCacheMap()
        Returns the underlying CacheMap that this cache is using. This is not an unmodifiable view on the map, so care should be taken with this reference. Implementations should probably not modify the contents of the cache, but should only use this reference to obtain cache metrics. Additionally, this map may contain expired data. Removal of timed-out data is done in a lazy fashion, so the actual size of the map may be greater than the number of non-expired query results in cache.
      • getCacheSize

        public int getCacheSize()
        Returns the maximum number of unpinned objects to keep hard references to.
      • setCacheSize

        public void setCacheSize​(int size)
        Sets the maximum number of unpinned objects to keep hard references to. If the map contains more unpinned objects than size, then this method will result in the cache flushing old values.
      • getSoftReferenceSize

        public int getSoftReferenceSize()
        Returns the maximum number of unpinned objects to keep soft references to. Defaults to -1.
      • setSoftReferenceSize

        public void setSoftReferenceSize​(int size)
        Sets the maximum number of unpinned objects to keep soft references to. If the map contains more soft references than size, then this method will result in the cache flushing values.
      • writeLock

        public void writeLock()
        Description copied from interface: QueryCache
        Obtain a write lock on the cache.
        Specified by:
        writeLock in interface QueryCache
      • writeUnlock

        public void writeUnlock()
        Description copied from interface: QueryCache
        Release the write lock on the cache.
        Specified by:
        writeUnlock in interface QueryCache
      • newCacheMap

        protected CacheMap newCacheMap()
        Return the map to use as an internal cache.
      • keySet

        protected java.util.Collection keySet()
        Description copied from class: AbstractQueryCache
        Return a threadsafe view of the keys in this cache. This collection must be iterable without risk of concurrent modification exceptions. It does not have to implement contains() efficiently or use set semantics.
        Specified by:
        keySet in class AbstractQueryCache
      • setLru

        public void setLru​(boolean l)
      • getLru

        public boolean getLru()