Class AllGranularity

  • All Implemented Interfaces:
    Cacheable

    public class AllGranularity
    extends Granularity
    AllGranularty buckets everything into a single bucket
    • Constructor Detail

      • AllGranularity

        public AllGranularity()
        This constructor is public b/c it is serialized and deserialized based on type in GranularityModule
    • Method Detail

      • increment

        public org.joda.time.DateTime increment​(org.joda.time.DateTime time)
        Specified by:
        increment in class Granularity
      • bucketStart

        public org.joda.time.DateTime bucketStart​(org.joda.time.DateTime time)
        Specified by:
        bucketStart in class Granularity
      • isAligned

        public boolean isAligned​(org.joda.time.Interval interval)
        No interval is aligned with all granularity since it's infinite.
        Specified by:
        isAligned in class Granularity
      • getCacheKey

        public byte[] getCacheKey()
        Description copied from interface: Cacheable
        Get a byte array used as a cache key.
        Returns:
        a cache key
      • getIterable

        public Iterable<org.joda.time.Interval> getIterable​(org.joda.time.Interval input)
        Description copied from class: Granularity
        Return an iterable of granular buckets that overlap a particular interval. In cases where the number of granular buckets is very large, the Iterable returned by this method will take an excessive amount of time to compute, and materializing it into a collection will take an excessive amount of memory. For example, this happens in the extreme case of an input interval of Intervals.ETERNITY and any granularity other than Granularities.ALL, as well as cases like an input interval of ten years with Granularities.SECOND. To avoid issues stemming from large numbers of buckets, this method should be avoided, and code that uses this method should be rewritten to use some other approach. For example: rather than computing all possible buckets in a wide time range, only process buckets related to actual data points that appear.
        Overrides:
        getIterable in class Granularity
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object