Class TagHistoryCache
java.lang.Object
com.inductiveautomation.ignition.common.sqltags.history.cache.TagHistoryCache
A cache system for SQLTags History data. It is currently available as a singleton, but for 3rd party use should be
instantiated.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Parameters with a different time range, and a return size adjusted accordingly. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all cached data.protected boolean
createRoomFor
(CacheBucket bucket) Used when inserting new buckets, tries to eject lower relevency buckets in order to make room.protected org.apache.log4j.Logger
long
static TagHistoryCache
protected org.apache.log4j.Logger
protected double
getWindowSize
(TagHistoryQueryParams params) Returns the window size for the query, or 1/0/-1 if the query mode isn't fixed results.protected boolean
hasRoomFor
(int size) boolean
query
(TagHistoryQueryProvider backingProvider, TagHistoryQueryParams queryParams) boolean
registerBucket
(CacheBucket bucket) Inserts a bucket into the cache.static void
reset()
Clears the internal instance, causing all of the cached data to be lost.void
setEnabled
(boolean value) void
setPolicy
(CachePolicy policy)
-
Constructor Details
-
TagHistoryCache
public TagHistoryCache() -
TagHistoryCache
-
-
Method Details
-
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
-
setPolicy
-
getLogger
protected org.apache.log4j.Logger getLogger() -
getBucketLogger
protected org.apache.log4j.Logger getBucketLogger() -
getWindowSize
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
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
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.
-