java.lang.Object
com.inductiveautomation.ignition.common.sqltags.history.cache.TagHistoryCache

public class TagHistoryCache extends Object
A cache system for SQLTags History data. It is currently available as a singleton, but for 3rd party use should be instantiated.
  • Constructor Details

    • TagHistoryCache

      public TagHistoryCache()
    • TagHistoryCache

      public TagHistoryCache(boolean enabled, CachePolicy policy)
  • Method Details

    • getInstance

      public static TagHistoryCache getInstance()
    • reset

      public static void reset()
      Clears the internal instance, causing all of the cached data to be lost.
    • clear

      public void clear()
      Clears all cached data.
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean value)
    • getPolicy

      public CachePolicy getPolicy()
    • setPolicy

      public void setPolicy(CachePolicy policy)
    • getLogger

      protected org.apache.log4j.Logger getLogger()
    • getBucketLogger

      protected org.apache.log4j.Logger getBucketLogger()
    • getWindowSize

      protected double getWindowSize(TagHistoryQueryParams params)
      Returns the window size for the query, or 1/0/-1 if the query mode isn't fixed results.
    • getCurrentMemorySize

      public long getCurrentMemorySize()
    • hasRoomFor

      protected boolean hasRoomFor(int size)
    • createRoomFor

      protected boolean createRoomFor(CacheBucket bucket)
      Used when inserting new buckets, tries to eject lower relevency buckets in order to make room. If there is already enough room, doesn't eject anything.
    • query

      public Dataset query(TagHistoryQueryProvider backingProvider, TagHistoryQueryParams queryParams) throws Exception
      Throws:
      Exception
    • registerBucket

      public boolean registerBucket(CacheBucket bucket)
      Inserts a bucket into the cache.
      Returns:
      false if there isn't enough room for the bucket's data. This means the bucket should discard its data and be provisional.