Class 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.
    • Method Detail

      • getLogger

        protected LoggerEx getLogger()
      • getWindowSize

        public java.lang.Double getWindowSize()
      • 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 class java.lang.Object