Class SubCache
- java.lang.Object
-
- com.inductiveautomation.ignition.common.sqltags.history.cache.SubCache
-
public class SubCache extends java.lang.Object
A SubCache resides under the main cache, and represents the cache for a certain set of parameters. The sub cache holds buckets, which in turn hold data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SubCache.BucketHit
-
Constructor Summary
Constructors Constructor Description SubCache(TagHistoryCache parent, CacheKey key, TagHistoryQueryParams params, double windowSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
containedIn(CacheBucket bucket, long time)
Returns whether the bucket contains the time.TagHistoryQueryParams
getCacheParams()
Dataset
getData(TagHistoryQueryProvider prov, TagHistoryQueryParams queryParams)
Gathers together the cached buckets, queries new data, and zips it together to return the final dataset that will be returned for the query.protected LoggerEx
getLogger()
protected TagHistoryCache
getParent()
int
getTimestampColumnPos()
Returns the position of the date column in the dataset generated by the query params.java.lang.Double
getWindowSize()
boolean
registerBucketData(CacheBucket bucket)
java.lang.String
toString()
protected TimeMaskedDataset
wrapDS(Dataset ds, long start, long end, boolean endIsInclusive)
"Masks" a data set to a specific time range.
-
-
-
Constructor Detail
-
SubCache
public SubCache(TagHistoryCache parent, CacheKey key, TagHistoryQueryParams params, double windowSize)
-
-
Method Detail
-
getLogger
protected LoggerEx getLogger()
-
getParent
protected TagHistoryCache getParent()
-
getWindowSize
public java.lang.Double getWindowSize()
-
getCacheParams
public TagHistoryQueryParams getCacheParams()
-
getTimestampColumnPos
public int getTimestampColumnPos()
Returns the position of the date column in the dataset generated by the query params.
-
registerBucketData
public boolean registerBucketData(CacheBucket bucket)
-
getData
public Dataset getData(TagHistoryQueryProvider prov, TagHistoryQueryParams queryParams) throws java.lang.Exception
Gathers together the cached buckets, queries new data, and zips it together to return the final dataset that will be returned for the query.- Parameters:
queryParams
- the parameters of this particular query. Our core params dictate our return, so we basically just want to use the start and end of the passed in params.- Throws:
java.lang.Exception
-
containedIn
protected boolean containedIn(CacheBucket bucket, long time)
Returns whether the bucket contains the time. Start is inclusive, end is exclusive.
-
wrapDS
protected TimeMaskedDataset wrapDS(Dataset ds, long start, long end, boolean endIsInclusive)
"Masks" a data set to a specific time range.- Parameters:
endIsInclusive
- if false, the end time used will actually be end-1, in order to avoid matching on "=" conditions.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-