Interface QueryCache

    • Method Detail

      • get

        QueryResult get​(QueryKey qk)
        Return a list of oids for the given query key. This is an unmodifiable list.
        Returns:
        The query results matching the given key, or null if none
      • put

        QueryResult put​(QueryKey qk,
                        QueryResult oids)
        Set the list of OIDs for the given query key. A reference to the given list will be stored in the query cache, so the list should not be modified after invoking this method.
        Returns:
        The previously cached value, or null if the key was not previously cached. See Map.put(K, V) for more information.
      • remove

        QueryResult remove​(QueryKey qk)
        Remove the value stored under the given query key. This method is typically not invoked directly from outside the QueryCache class. Instead, the cache should be updated by implementing RemoteCommitListener, which will result in all queries that may be invalid being dropped.
        Returns:
        The previously cached value, or null if the key was not previously cached. See Map.remove(java.lang.Object) for more information.
      • clear

        void clear()
        Remove all data from this cache.
      • unpin

        boolean unpin​(QueryKey qk)
        Unpin the value stored under key into the cache. This method reverses a previous invocation of pin(org.apache.openjpa.datacache.QueryKey). This method does not remove anything from the cache; it merely makes key's value a candidate for flushing from the cache.
        Returns:
        true if key's value was unpinned from the cache; false if the key is not in the cache.
      • writeLock

        void writeLock()
        Obtain a write lock on the cache.
      • writeUnlock

        void writeUnlock()
        Release the write lock on the cache.
      • addTypesChangedListener

        void addTypesChangedListener​(TypesChangedListener listen)
        Add a new types event listener to this cache.
        Since:
        0.3.3
      • removeTypesChangedListener

        boolean removeTypesChangedListener​(TypesChangedListener listen)
        Remove an types event listener from this cache.
        Since:
        0.3.3
      • close

        void close()
        Free the resources used by this cache.
        Specified by:
        close in interface Closeable
      • getStatistics

        QueryStatistics<QueryKey> getStatistics()
        Gets the simple statistics for query results. If the statistics gathering is disabled, an empty statistics is returned.
        Since:
        2.1.0