Class DurationGranularity
java.lang.Object
org.apache.druid.java.util.common.granularity.Granularity
org.apache.druid.java.util.common.granularity.DurationGranularity
- All Implemented Interfaces:
Cacheable
DurationGranularity buckets data based on the length of a duration
-
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
ConstructorsConstructorDescriptionDurationGranularity(long duration, long origin) DurationGranularity(long duration, org.joda.time.DateTime origin) -
Method Summary
Modifier and TypeMethodDescriptionlongbucketStart(long t) org.joda.time.DateTimebucketStart(org.joda.time.DateTime time) booleanbyte[]Get a byte array used as a cache key.longlongorg.joda.time.format.DateTimeFormatterorg.joda.time.DateTimeinthashCode()longincrement(long time) org.joda.time.DateTimeincrement(org.joda.time.DateTime time) booleanisAligned(org.joda.time.Interval interval) Return true only if the time chunks populated by this granularity includes the given interval time chunk.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, getIterable, getTimeZone, granularitiesFinerThan, isFinerThan, mergeGranularities, toDate, toDateTime, toPath
-
Constructor Details
-
DurationGranularity
public DurationGranularity(long duration, org.joda.time.DateTime origin) -
DurationGranularity
public DurationGranularity(long duration, long origin)
-
-
Method Details
-
getDuration
public long getDuration() -
getOrigin
public org.joda.time.DateTime getOrigin() -
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 t) - 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) Description copied from class:GranularityReturn true only if the time chunks populated by this granularity includes the given interval time chunk. The interval must fit exactly into the scheme of the granularity for this to return true- 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.
-
getDurationMillis
public long getDurationMillis() -
equals
-
hashCode
public int hashCode() -
toString
-