Class AllGranularity
java.lang.Object
org.apache.druid.java.util.common.granularity.Granularity
org.apache.druid.java.util.common.granularity.AllGranularity
- All Implemented Interfaces:
Cacheable
AllGranularty buckets everything into a single bucket
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.druid.java.util.common.granularity.Granularity
Granularity.Formatter -
Field Summary
Fields inherited from class org.apache.druid.java.util.common.granularity.Granularity
IS_FINER_THAN -
Constructor Summary
ConstructorsConstructorDescriptionThis constructor is public b/c it is serialized and deserialized based on type in GranularityModule -
Method Summary
Modifier and TypeMethodDescriptionlongbucketStart(long time) org.joda.time.DateTimebucketStart(org.joda.time.DateTime time) booleanbyte[]Get a byte array used as a cache key.org.joda.time.format.DateTimeFormatterIterable<org.joda.time.Interval> getIterable(org.joda.time.Interval input) Return an iterable of granular buckets that overlap a particular interval.inthashCode()longincrement(long time) org.joda.time.DateTimeincrement(org.joda.time.DateTime time) booleanisAligned(org.joda.time.Interval interval) No interval is aligned with all granularity since it's infinite.org.joda.time.DateTimetoDate(String filePath, Granularity.Formatter formatter) toString()Methods inherited from class org.apache.druid.java.util.common.granularity.Granularity
bucket, bucketEnd, fromString, getTimeZone, granularitiesFinerThan, isFinerThan, mergeGranularities, toDate, toDateTime, toPath
-
Constructor Details
-
AllGranularity
public AllGranularity()This constructor is public b/c it is serialized and deserialized based on type in GranularityModule
-
-
Method Details
-
getFormatter
- Specified by:
getFormatterin classGranularity
-
increment
public long increment(long time) - Specified by:
incrementin classGranularity
-
increment
public org.joda.time.DateTime increment(org.joda.time.DateTime time) - Specified by:
incrementin classGranularity
-
bucketStart
public long bucketStart(long time) - Specified by:
bucketStartin classGranularity
-
bucketStart
public org.joda.time.DateTime bucketStart(org.joda.time.DateTime time) - Specified by:
bucketStartin classGranularity
-
toDate
- Specified by:
toDatein classGranularity
-
isAligned
public boolean isAligned(org.joda.time.Interval interval) No interval is aligned with all granularity since it's infinite.- Specified by:
isAlignedin classGranularity
-
getCacheKey
public byte[] getCacheKey()Description copied from interface:CacheableGet a byte array used as a cache key.- Returns:
- bytes to be used as cache key - or null if this object should not be cached.
-
getIterable
Description copied from class:GranularityReturn 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 ofIntervals.ETERNITYand any granularity other thanGranularities.ALL, as well as cases like an input interval of ten years withGranularities.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:
getIterablein classGranularity
-
equals
-
hashCode
public int hashCode() -
toString
-