Class QueryContextCache


  • public class QueryContextCache
    extends Object
    Most Recently Used and Priority based cache. A separate cache for each connection in the driver.
    • Constructor Detail

      • QueryContextCache

        public QueryContextCache​(int capacity)
        Constructor.
        Parameters:
        capacity - Maximum capacity of the cache.
    • Method Detail

      • clearCache

        public void clearCache()
        Clear the cache.
      • deserializeQueryContextJson

        public void deserializeQueryContextJson​(String data)
        Parameters:
        data - : the QueryContext Object serialized as a JSON format string
      • deserializeQueryContextDTO

        public void deserializeQueryContextDTO​(QueryContextDTO queryContextDTO)
        Deserialize the QueryContext cache from a QueryContextDTO object. This function currently is only used in QueryContextCacheTest.java where we check that after serialization and deserialization, the cache is the same as before.
      • serializeQueryContextDTO

        public QueryContextDTO serializeQueryContextDTO()
        Serialize the QueryContext cache to a QueryContextDTO object, which can be serialized to JSON automatically later.