Interface QueryDatastoreCompilationCache

All Known Implementing Classes:
AbstractQueryDatastoreCompilationCache, JavaxCacheQueryDatastoreCompilationCache, SoftQueryDatastoreCompilationCache, StrongQueryDatastoreCompilationCache, WeakQueryDatastoreCompilationCache

public interface QueryDatastoreCompilationCache
Cache for query compilations (datastore-specific).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Method to clear the cache.
    void
    Method to close the cache when no longer needed.
    boolean
    contains(String queryKey)
    Accessor for whether the specified query is in the cache
    void
    evict(String queryKey)
    Evict the query from the compilation cache.
    get(String queryKey)
    Accessor for a (generic) compilation from the cache.
    boolean
    Accessor for whether the cache is empty.
    put(String queryKey, Object compilation)
    Method to put an object in the cache.
    int
    Accessor for the total number of compilations in the query cache.
  • Method Details

    • close

      void close()
      Method to close the cache when no longer needed. Provides a hook to release resources etc.
    • evict

      void evict(String queryKey)
      Evict the query from the compilation cache.
      Parameters:
      queryKey - Key for the query to evict.
    • clear

      void clear()
      Method to clear the cache.
    • isEmpty

      boolean isEmpty()
      Accessor for whether the cache is empty.
      Returns:
      Whether it is empty.
    • size

      int size()
      Accessor for the total number of compilations in the query cache.
      Returns:
      Number of queries
    • get

      Object get(String queryKey)
      Accessor for a (generic) compilation from the cache.
      Parameters:
      queryKey - The query key
      Returns:
      The cached query compilation
    • put

      Object put(String queryKey, Object compilation)
      Method to put an object in the cache.
      Parameters:
      queryKey - The query key
      compilation - The compilation for this datastore
      Returns:
      The cached compilation previously associated with this query (if any)
    • contains

      boolean contains(String queryKey)
      Accessor for whether the specified query is in the cache
      Parameters:
      queryKey - The query key
      Returns:
      Whether it is in the cache